Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
328939fd
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
328939fd
编写于
12月 12, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move deleteAllRight out of the editor core (#8575)
上级
c47b8c87
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
53 addition
and
44 deletion
+53
-44
src/vs/editor/common/config/config.ts
src/vs/editor/common/config/config.ts
+0
-10
src/vs/editor/common/controller/cursor.ts
src/vs/editor/common/controller/cursor.ts
+0
-5
src/vs/editor/common/controller/cursorDeleteOperations.ts
src/vs/editor/common/controller/cursorDeleteOperations.ts
+0
-26
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+0
-2
src/vs/editor/contrib/linesOperations/common/linesOperations.ts
.../editor/contrib/linesOperations/common/linesOperations.ts
+53
-0
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+0
-1
未找到文件。
src/vs/editor/common/config/config.ts
浏览文件 @
328939fd
...
...
@@ -603,16 +603,6 @@ registerCommand(new CoreCommand({
mac
:
{
primary
:
KeyCode
.
Delete
,
secondary
:
[
KeyMod
.
WinCtrl
|
KeyCode
.
KEY_D
,
KeyMod
.
WinCtrl
|
KeyCode
.
Delete
]
}
}
}));
registerCommand
(
new
CoreCommand
({
id
:
H
.
DeleteAllRight
,
precondition
:
EditorContextKeys
.
Writable
,
kbOpts
:
{
weight
:
CORE_WEIGHT
,
kbExpr
:
EditorContextKeys
.
TextFocus
,
primary
:
null
,
mac
:
{
primary
:
KeyMod
.
WinCtrl
|
KeyCode
.
KEY_K
,
secondary
:
[
KeyMod
.
CtrlCmd
|
KeyCode
.
Delete
]
}
}
}));
registerCommand
(
new
WordCommand
(
H
.
CursorWordStartLeft
,
false
,
KeyCode
.
LeftArrow
));
...
...
src/vs/editor/common/controller/cursor.ts
浏览文件 @
328939fd
...
...
@@ -1001,7 +1001,6 @@ export class Cursor extends EventEmitter {
this
.
_handlers
[
H
.
DeleteWordStartRight
]
=
(
ctx
)
=>
this
.
_deleteWordRight
(
false
,
WordNavigationType
.
WordStart
,
ctx
);
this
.
_handlers
[
H
.
DeleteWordEndRight
]
=
(
ctx
)
=>
this
.
_deleteWordRight
(
false
,
WordNavigationType
.
WordEnd
,
ctx
);
this
.
_handlers
[
H
.
DeleteAllRight
]
=
(
ctx
)
=>
this
.
_deleteAllRight
(
ctx
);
this
.
_handlers
[
H
.
Cut
]
=
(
ctx
)
=>
this
.
_cut
(
ctx
);
this
.
_handlers
[
H
.
ExpandLineSelection
]
=
(
ctx
)
=>
this
.
_expandLineSelection
(
ctx
);
...
...
@@ -1509,10 +1508,6 @@ export class Cursor extends EventEmitter {
return
this
.
_applyEditForAll
(
ctx
,
(
cursor
)
=>
WordOperations
.
deleteWordRight
(
cursor
.
config
,
cursor
.
model
,
cursor
.
modelState
,
whitespaceHeuristics
,
wordNavigationType
));
}
private
_deleteAllRight
(
ctx
:
IMultipleCursorOperationContext
):
boolean
{
return
this
.
_applyEditForAll
(
ctx
,
(
cursor
)
=>
DeleteOperations
.
deleteAllRight
(
cursor
.
config
,
cursor
.
model
,
cursor
.
modelState
));
}
private
_cut
(
ctx
:
IMultipleCursorOperationContext
):
boolean
{
return
this
.
_applyEditForAll
(
ctx
,
(
cursor
)
=>
DeleteOperations
.
cut
(
cursor
.
config
,
cursor
.
model
,
cursor
.
modelState
,
this
.
enableEmptySelectionClipboard
));
}
...
...
src/vs/editor/common/controller/cursorDeleteOperations.ts
浏览文件 @
328939fd
...
...
@@ -43,32 +43,6 @@ export class DeleteOperations {
});
}
public
static
deleteAllRight
(
config
:
CursorConfiguration
,
model
:
ICursorSimpleModel
,
cursor
:
SingleCursorState
):
EditOperationResult
{
let
selection
=
cursor
.
selection
;
if
(
selection
.
isEmpty
())
{
let
position
=
cursor
.
position
;
let
lineNumber
=
position
.
lineNumber
;
let
column
=
position
.
column
;
let
maxColumn
=
model
.
getLineMaxColumn
(
lineNumber
);
if
(
column
===
maxColumn
)
{
// Ignore deleting at end of file
return
null
;
}
let
deleteSelection
=
new
Range
(
lineNumber
,
column
,
lineNumber
,
maxColumn
);
if
(
!
deleteSelection
.
isEmpty
())
{
return
new
EditOperationResult
(
new
ReplaceCommand
(
deleteSelection
,
''
),
{
shouldPushStackElementBefore
:
false
,
shouldPushStackElementAfter
:
false
});
}
}
return
this
.
deleteRight
(
config
,
model
,
cursor
);
}
public
static
autoClosingPairDelete
(
config
:
CursorConfiguration
,
model
:
ICursorSimpleModel
,
cursor
:
SingleCursorState
):
EditOperationResult
{
if
(
!
config
.
autoClosingBrackets
)
{
return
null
;
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
328939fd
...
...
@@ -4472,8 +4472,6 @@ export var Handler = {
DeleteWordStartRight
:
'
deleteWordStartRight
'
,
DeleteWordEndRight
:
'
deleteWordEndRight
'
,
DeleteAllRight
:
'
deleteAllRight
'
,
RemoveSecondaryCursors
:
'
removeSecondaryCursors
'
,
CancelSelection
:
'
cancelSelection
'
,
...
...
src/vs/editor/contrib/linesOperations/common/linesOperations.ts
浏览文件 @
328939fd
...
...
@@ -403,6 +403,59 @@ export class DeleteAllLeftAction extends EditorAction {
}
}
@
editorAction
export
class
DeleteAllRightAction
extends
EditorAction
{
constructor
()
{
super
({
id
:
'
deleteAllRight
'
,
label
:
nls
.
localize
(
'
lines.deleteAllRight
'
,
"
Delete All Right
"
),
alias
:
'
Delete All Right
'
,
precondition
:
EditorContextKeys
.
Writable
,
kbOpts
:
{
kbExpr
:
EditorContextKeys
.
TextFocus
,
primary
:
null
,
mac
:
{
primary
:
KeyMod
.
WinCtrl
|
KeyCode
.
KEY_K
,
secondary
:
[
KeyMod
.
CtrlCmd
|
KeyCode
.
Delete
]
}
}
});
}
public
run
(
accessor
:
ServicesAccessor
,
editor
:
ICommonCodeEditor
):
void
{
let
model
=
editor
.
getModel
();
let
rangesToDelete
:
Range
[]
=
editor
.
getSelections
().
map
((
sel
)
=>
{
if
(
sel
.
isEmpty
())
{
let
maxColumn
=
model
.
getLineMaxColumn
(
sel
.
startLineNumber
);
return
new
Range
(
sel
.
startLineNumber
,
sel
.
startColumn
,
sel
.
startLineNumber
,
maxColumn
);
}
return
sel
;
});
rangesToDelete
.
sort
(
Range
.
compareRangesUsingStarts
);
// merge overlapping selections
let
effectiveRanges
:
Range
[]
=
[];
for
(
let
i
=
0
,
count
=
rangesToDelete
.
length
-
1
;
i
<
count
;
i
++
)
{
let
range
=
rangesToDelete
[
i
];
let
nextRange
=
rangesToDelete
[
i
+
1
];
if
(
Range
.
intersectRanges
(
range
,
nextRange
)
===
null
)
{
effectiveRanges
.
push
(
range
);
}
else
{
rangesToDelete
[
i
+
1
]
=
Range
.
plusRange
(
range
,
nextRange
);
}
}
effectiveRanges
.
push
(
rangesToDelete
[
rangesToDelete
.
length
-
1
]);
let
edits
:
IIdentifiedSingleEditOperation
[]
=
effectiveRanges
.
map
(
range
=>
{
return
EditOperation
.
replace
(
range
,
''
);
});
editor
.
executeEdits
(
this
.
id
,
edits
);
}
}
@
editorAction
export
class
JoinLinesAction
extends
EditorAction
{
constructor
()
{
...
...
src/vs/monaco.d.ts
浏览文件 @
328939fd
...
...
@@ -3383,7 +3383,6 @@ declare module monaco.editor {
DeleteWordRight
:
string
;
DeleteWordStartRight
:
string
;
DeleteWordEndRight
:
string
;
DeleteAllRight
:
string
;
RemoveSecondaryCursors
:
string
;
CancelSelection
:
string
;
Cut
:
string
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录