Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
954b93af
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
954b93af
编写于
10月 13, 2016
作者:
K
Kai Wood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add setting to prevent copying empty selections
上级
47e2a847
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
2 deletion
+26
-2
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+6
-0
src/vs/editor/common/config/defaultConfig.ts
src/vs/editor/common/config/defaultConfig.ts
+1
-0
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+8
-0
src/vs/editor/contrib/clipboard/browser/clipboard.ts
src/vs/editor/contrib/clipboard/browser/clipboard.ts
+6
-2
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+5
-0
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
954b93af
...
...
@@ -310,6 +310,7 @@ class InternalEditorOptionsHelper {
suggestOnTriggerCharacters
:
toBoolean
(
opts
.
suggestOnTriggerCharacters
),
acceptSuggestionOnEnter
:
toBoolean
(
opts
.
acceptSuggestionOnEnter
),
snippetSuggestions
:
opts
.
snippetSuggestions
,
emptySelectionClipboard
:
opts
.
emptySelectionClipboard
,
tabCompletion
:
opts
.
tabCompletion
,
wordBasedSuggestions
:
opts
.
wordBasedSuggestions
,
suggestFontSize
:
opts
.
suggestFontSize
,
...
...
@@ -762,6 +763,11 @@ let editorConfiguration: IConfigurationNode = {
'
default
'
:
DefaultConfig
.
editor
.
snippetSuggestions
,
'
description
'
:
nls
.
localize
(
'
snippetSuggestions
'
,
"
Controls whether snippets are shown with other suggestions and how they are sorted.
"
)
},
'
editor.emptySelectionClipboard
'
:
{
'
type
'
:
'
boolean
'
,
'
default
'
:
DefaultConfig
.
editor
.
emptySelectionClipboard
,
'
description
'
:
nls
.
localize
(
'
emptySelectionClipboard
'
,
"
Controls whether copying without a selection copies the current line.
"
)
},
'
editor.wordBasedSuggestions
'
:
{
'
type
'
:
'
boolean
'
,
'
default
'
:
DefaultConfig
.
editor
.
wordBasedSuggestions
,
...
...
src/vs/editor/common/config/defaultConfig.ts
浏览文件 @
954b93af
...
...
@@ -85,6 +85,7 @@ class ConfigClass implements IConfiguration {
suggestOnTriggerCharacters
:
true
,
acceptSuggestionOnEnter
:
true
,
snippetSuggestions
:
'
bottom
'
,
emptySelectionClipboard
:
true
,
tabCompletion
:
false
,
wordBasedSuggestions
:
true
,
suggestFontSize
:
0
,
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
954b93af
...
...
@@ -402,6 +402,10 @@ export interface IEditorOptions {
* Enable snippet suggestions. Default to 'true'.
*/
snippetSuggestions
?:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
/**
* Copying without a selection copies the current line.
*/
emptySelectionClipboard
?:
boolean
;
/**
* Enable tab completion. Defaults to 'false'
*/
...
...
@@ -862,6 +866,7 @@ export class EditorContribOptions {
readonly
suggestOnTriggerCharacters
:
boolean
;
readonly
acceptSuggestionOnEnter
:
boolean
;
readonly
snippetSuggestions
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
readonly
emptySelectionClipboard
:
boolean
;
readonly
tabCompletion
:
boolean
;
readonly
wordBasedSuggestions
:
boolean
;
readonly
suggestFontSize
:
number
;
...
...
@@ -885,6 +890,7 @@ export class EditorContribOptions {
suggestOnTriggerCharacters
:
boolean
;
acceptSuggestionOnEnter
:
boolean
;
snippetSuggestions
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
emptySelectionClipboard
:
boolean
;
tabCompletion
:
boolean
;
wordBasedSuggestions
:
boolean
;
suggestFontSize
:
number
;
...
...
@@ -904,6 +910,7 @@ export class EditorContribOptions {
this
.
suggestOnTriggerCharacters
=
Boolean
(
source
.
suggestOnTriggerCharacters
);
this
.
acceptSuggestionOnEnter
=
Boolean
(
source
.
acceptSuggestionOnEnter
);
this
.
snippetSuggestions
=
source
.
snippetSuggestions
;
this
.
emptySelectionClipboard
=
source
.
emptySelectionClipboard
;
this
.
tabCompletion
=
source
.
tabCompletion
;
this
.
wordBasedSuggestions
=
source
.
wordBasedSuggestions
;
this
.
suggestFontSize
=
source
.
suggestFontSize
;
...
...
@@ -929,6 +936,7 @@ export class EditorContribOptions {
&&
this
.
suggestOnTriggerCharacters
===
other
.
suggestOnTriggerCharacters
&&
this
.
acceptSuggestionOnEnter
===
other
.
acceptSuggestionOnEnter
&&
this
.
snippetSuggestions
===
other
.
snippetSuggestions
&&
this
.
emptySelectionClipboard
===
other
.
emptySelectionClipboard
&&
this
.
tabCompletion
===
other
.
tabCompletion
&&
this
.
wordBasedSuggestions
===
other
.
wordBasedSuggestions
&&
this
.
suggestFontSize
===
other
.
suggestFontSize
...
...
src/vs/editor/contrib/clipboard/browser/clipboard.ts
浏览文件 @
954b93af
...
...
@@ -73,7 +73,9 @@ class ExecCommandCutAction extends ExecCommandAction {
}
public
run
(
accessor
:
ServicesAccessor
,
editor
:
editorCommon
.
ICommonCodeEditor
):
void
{
if
(
!
browser
.
enableEmptySelectionClipboard
&&
editor
.
getSelection
().
isEmpty
())
{
var
enableEmptySelectionClipboard
=
editor
.
getConfiguration
().
contribInfo
.
emptySelectionClipboard
&&
browser
.
enableEmptySelectionClipboard
;
if
(
!
enableEmptySelectionClipboard
&&
editor
.
getSelection
().
isEmpty
())
{
return
;
}
...
...
@@ -103,7 +105,9 @@ class ExecCommandCopyAction extends ExecCommandAction {
}
public
run
(
accessor
:
ServicesAccessor
,
editor
:
editorCommon
.
ICommonCodeEditor
):
void
{
if
(
!
browser
.
enableEmptySelectionClipboard
&&
editor
.
getSelection
().
isEmpty
())
{
var
enableEmptySelectionClipboard
=
editor
.
getConfiguration
().
contribInfo
.
emptySelectionClipboard
&&
browser
.
enableEmptySelectionClipboard
;
if
(
!
enableEmptySelectionClipboard
&&
editor
.
getSelection
().
isEmpty
())
{
return
;
}
...
...
src/vs/monaco.d.ts
浏览文件 @
954b93af
...
...
@@ -1262,6 +1262,10 @@ declare module monaco.editor {
* Enable snippet suggestions. Default to 'true'.
*/
snippetSuggestions
?:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
/**
* Copying without a selection copies the current line.
*/
emptySelectionClipboard
?:
boolean
;
/**
* Enable tab completion. Defaults to 'false'
*/
...
...
@@ -1458,6 +1462,7 @@ declare module monaco.editor {
readonly
suggestOnTriggerCharacters
:
boolean
;
readonly
acceptSuggestionOnEnter
:
boolean
;
readonly
snippetSuggestions
:
'
top
'
|
'
bottom
'
|
'
inline
'
|
'
none
'
;
readonly
emptySelectionClipboard
:
boolean
;
readonly
tabCompletion
:
boolean
;
readonly
wordBasedSuggestions
:
boolean
;
readonly
suggestFontSize
:
number
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录