Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
49b07391
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,发现更多精彩内容 >>
提交
49b07391
编写于
8月 29, 2016
作者:
A
Alexandru Dima
提交者:
GitHub
8月 29, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11115 from Microsoft/sandy081/renameLineHighlight
Rename lineHighlight to rangeHighlight
上级
02513b84
31bd49c0
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
58 addition
and
58 deletion
+58
-58
src/vs/editor/browser/widget/media/editor.css
src/vs/editor/browser/widget/media/editor.css
+4
-4
src/vs/editor/contrib/find/common/findDecorations.ts
src/vs/editor/contrib/find/common/findDecorations.ts
+13
-13
src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts
src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts
+9
-9
src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts
src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts
+16
-16
src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
...vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
+16
-16
未找到文件。
src/vs/editor/browser/widget/media/editor.css
浏览文件 @
49b07391
...
...
@@ -112,11 +112,11 @@
top
:
0
;
}
/* -------------------- Highlight a
lin
e -------------------- */
/* -------------------- Highlight a
rang
e -------------------- */
.monaco-editor.vs
.
lin
eHighlight
{
background
:
rgba
(
253
,
255
,
0
,
0.2
);
}
.monaco-editor.vs-dark
.
lin
eHighlight
{
background
:
rgba
(
243
,
240
,
245
,
0.2
);
}
.monaco-editor.hc-black
.
lin
eHighlight
{
background
:
rgba
(
243
,
240
,
245
,
0.2
);
}
.monaco-editor.vs
.
rang
eHighlight
{
background
:
rgba
(
253
,
255
,
0
,
0.2
);
}
.monaco-editor.vs-dark
.
rang
eHighlight
{
background
:
rgba
(
243
,
240
,
245
,
0.2
);
}
.monaco-editor.hc-black
.
rang
eHighlight
{
background
:
rgba
(
243
,
240
,
245
,
0.2
);
}
/* -------------------- Squigglies -------------------- */
...
...
src/vs/editor/contrib/find/common/findDecorations.ts
浏览文件 @
49b07391
...
...
@@ -14,7 +14,7 @@ export class FindDecorations implements IDisposable {
private
_editor
:
editorCommon
.
ICommonCodeEditor
;
private
_decorations
:
string
[];
private
_findScopeDecorationId
:
string
;
private
_
lin
eHighlightDecorationId
:
string
;
private
_
rang
eHighlightDecorationId
:
string
;
private
_highlightedDecorationId
:
string
;
private
_startPosition
:
Position
;
...
...
@@ -22,7 +22,7 @@ export class FindDecorations implements IDisposable {
this
.
_editor
=
editor
;
this
.
_decorations
=
[];
this
.
_findScopeDecorationId
=
null
;
this
.
_
lin
eHighlightDecorationId
=
null
;
this
.
_
rang
eHighlightDecorationId
=
null
;
this
.
_highlightedDecorationId
=
null
;
this
.
_startPosition
=
this
.
_editor
.
getPosition
();
}
...
...
@@ -33,7 +33,7 @@ export class FindDecorations implements IDisposable {
this
.
_editor
=
null
;
this
.
_decorations
=
[];
this
.
_findScopeDecorationId
=
null
;
this
.
_
lin
eHighlightDecorationId
=
null
;
this
.
_
rang
eHighlightDecorationId
=
null
;
this
.
_highlightedDecorationId
=
null
;
this
.
_startPosition
=
null
;
}
...
...
@@ -41,7 +41,7 @@ export class FindDecorations implements IDisposable {
public
reset
():
void
{
this
.
_decorations
=
[];
this
.
_findScopeDecorationId
=
null
;
this
.
_
lin
eHighlightDecorationId
=
null
;
this
.
_
rang
eHighlightDecorationId
=
null
;
this
.
_highlightedDecorationId
=
null
;
}
...
...
@@ -99,13 +99,13 @@ export class FindDecorations implements IDisposable {
this
.
_highlightedDecorationId
=
newCurrentDecorationId
;
changeAccessor
.
changeDecorationOptions
(
this
.
_highlightedDecorationId
,
FindDecorations
.
createFindMatchDecorationOptions
(
true
));
}
if
(
this
.
_
lin
eHighlightDecorationId
!==
null
)
{
changeAccessor
.
removeDecoration
(
this
.
_
lin
eHighlightDecorationId
);
this
.
_
lin
eHighlightDecorationId
=
null
;
if
(
this
.
_
rang
eHighlightDecorationId
!==
null
)
{
changeAccessor
.
removeDecoration
(
this
.
_
rang
eHighlightDecorationId
);
this
.
_
rang
eHighlightDecorationId
=
null
;
}
if
(
newCurrentDecorationId
!==
null
)
{
let
rng
=
this
.
_editor
.
getModel
().
getDecorationRange
(
newCurrentDecorationId
);
this
.
_
lineHighlightDecorationId
=
changeAccessor
.
addDecoration
(
rng
,
FindDecorations
.
createLin
eHighlightDecoration
());
this
.
_
rangeHighlightDecorationId
=
changeAccessor
.
addDecoration
(
rng
,
FindDecorations
.
createRang
eHighlightDecoration
());
}
});
}
...
...
@@ -134,7 +134,7 @@ export class FindDecorations implements IDisposable {
this
.
_findScopeDecorationId
=
null
;
}
this
.
_decorations
=
tmpDecorations
;
this
.
_
lin
eHighlightDecorationId
=
null
;
this
.
_
rang
eHighlightDecorationId
=
null
;
this
.
_highlightedDecorationId
=
null
;
}
...
...
@@ -144,8 +144,8 @@ export class FindDecorations implements IDisposable {
if
(
this
.
_findScopeDecorationId
)
{
result
.
push
(
this
.
_findScopeDecorationId
);
}
if
(
this
.
_
lin
eHighlightDecorationId
)
{
result
.
push
(
this
.
_
lin
eHighlightDecorationId
);
if
(
this
.
_
rang
eHighlightDecorationId
)
{
result
.
push
(
this
.
_
rang
eHighlightDecorationId
);
}
return
result
;
}
...
...
@@ -162,10 +162,10 @@ export class FindDecorations implements IDisposable {
};
}
private
static
create
Lin
eHighlightDecoration
():
editorCommon
.
IModelDecorationOptions
{
private
static
create
Rang
eHighlightDecoration
():
editorCommon
.
IModelDecorationOptions
{
return
{
stickiness
:
editorCommon
.
TrackedRangeStickiness
.
NeverGrowsWhenTypingAtEdges
,
className
:
'
lin
eHighlight
'
,
className
:
'
rang
eHighlight
'
,
isWholeLine
:
true
};
}
...
...
src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts
浏览文件 @
49b07391
...
...
@@ -29,7 +29,7 @@ export class QuickOpenController implements editorCommon.IEditorContribution {
private
editor
:
ICodeEditor
;
private
widget
:
QuickOpenEditorWidget
;
private
lin
eHighlightDecorationId
:
string
;
private
rang
eHighlightDecorationId
:
string
;
private
lastKnownEditorSelection
:
Selection
;
constructor
(
editor
:
ICodeEditor
)
{
...
...
@@ -93,31 +93,31 @@ export class QuickOpenController implements editorCommon.IEditorContribution {
public
decorateLine
(
range
:
editorCommon
.
IRange
,
editor
:
ICodeEditor
):
void
{
editor
.
changeDecorations
((
changeAccessor
:
editorCommon
.
IModelDecorationsChangeAccessor
)
=>
{
var
oldDecorations
:
string
[]
=
[];
if
(
this
.
lin
eHighlightDecorationId
)
{
oldDecorations
.
push
(
this
.
lin
eHighlightDecorationId
);
this
.
lin
eHighlightDecorationId
=
null
;
if
(
this
.
rang
eHighlightDecorationId
)
{
oldDecorations
.
push
(
this
.
rang
eHighlightDecorationId
);
this
.
rang
eHighlightDecorationId
=
null
;
}
var
newDecorations
:
editorCommon
.
IModelDeltaDecoration
[]
=
[
{
range
:
range
,
options
:
{
className
:
'
lin
eHighlight
'
,
className
:
'
rang
eHighlight
'
,
isWholeLine
:
true
}
}
];
var
decorations
=
changeAccessor
.
deltaDecorations
(
oldDecorations
,
newDecorations
);
this
.
lin
eHighlightDecorationId
=
decorations
[
0
];
this
.
rang
eHighlightDecorationId
=
decorations
[
0
];
});
}
public
clearDecorations
():
void
{
if
(
this
.
lin
eHighlightDecorationId
)
{
if
(
this
.
rang
eHighlightDecorationId
)
{
this
.
editor
.
changeDecorations
((
changeAccessor
:
editorCommon
.
IModelDecorationsChangeAccessor
)
=>
{
changeAccessor
.
deltaDecorations
([
this
.
lin
eHighlightDecorationId
],
[]);
this
.
lin
eHighlightDecorationId
=
null
;
changeAccessor
.
deltaDecorations
([
this
.
rang
eHighlightDecorationId
],
[]);
this
.
rang
eHighlightDecorationId
=
null
;
});
}
}
...
...
src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts
浏览文件 @
49b07391
...
...
@@ -161,13 +161,13 @@ class GotoLineEntry extends EditorQuickOpenEntry {
}
interface
IEditorLineDecoration
{
lin
eHighlightId
:
string
;
rang
eHighlightId
:
string
;
lineDecorationId
:
string
;
position
:
Position
;
}
export
class
GotoLineHandler
extends
QuickOpenHandler
{
private
lin
eHighlightDecorationId
:
IEditorLineDecoration
;
private
rang
eHighlightDecorationId
:
IEditorLineDecoration
;
private
lastKnownEditorViewState
:
IEditorViewState
;
constructor
(
@
IWorkbenchEditorService
private
editorService
:
IWorkbenchEditorService
)
{
...
...
@@ -200,18 +200,18 @@ export class GotoLineHandler extends QuickOpenHandler {
editor
.
changeDecorations
((
changeAccessor
:
IModelDecorationsChangeAccessor
)
=>
{
let
deleteDecorations
:
string
[]
=
[];
if
(
this
.
lin
eHighlightDecorationId
)
{
deleteDecorations
.
push
(
this
.
lin
eHighlightDecorationId
.
lineDecorationId
);
deleteDecorations
.
push
(
this
.
lineHighlightDecorationId
.
lin
eHighlightId
);
this
.
lin
eHighlightDecorationId
=
null
;
if
(
this
.
rang
eHighlightDecorationId
)
{
deleteDecorations
.
push
(
this
.
rang
eHighlightDecorationId
.
lineDecorationId
);
deleteDecorations
.
push
(
this
.
rangeHighlightDecorationId
.
rang
eHighlightId
);
this
.
rang
eHighlightDecorationId
=
null
;
}
let
newDecorations
:
IModelDeltaDecoration
[]
=
[
//
lin
eHighlight at index 0
//
rang
eHighlight at index 0
{
range
:
range
,
options
:
{
className
:
'
lin
eHighlight
'
,
className
:
'
rang
eHighlight
'
,
isWholeLine
:
true
}
},
...
...
@@ -230,11 +230,11 @@ export class GotoLineHandler extends QuickOpenHandler {
];
let
decorations
=
changeAccessor
.
deltaDecorations
(
deleteDecorations
,
newDecorations
);
let
lin
eHighlightId
=
decorations
[
0
];
let
rang
eHighlightId
=
decorations
[
0
];
let
lineDecorationId
=
decorations
[
1
];
this
.
lin
eHighlightDecorationId
=
{
lineHighlightId
:
lin
eHighlightId
,
this
.
rang
eHighlightDecorationId
=
{
rangeHighlightId
:
rang
eHighlightId
,
lineDecorationId
:
lineDecorationId
,
position
:
position
};
...
...
@@ -242,20 +242,20 @@ export class GotoLineHandler extends QuickOpenHandler {
}
public
clearDecorations
():
void
{
if
(
this
.
lin
eHighlightDecorationId
)
{
if
(
this
.
rang
eHighlightDecorationId
)
{
this
.
editorService
.
getVisibleEditors
().
forEach
((
editor
)
=>
{
if
(
editor
.
position
===
this
.
lin
eHighlightDecorationId
.
position
)
{
if
(
editor
.
position
===
this
.
rang
eHighlightDecorationId
.
position
)
{
let
editorControl
=
<
IEditor
>
editor
.
getControl
();
editorControl
.
changeDecorations
((
changeAccessor
:
IModelDecorationsChangeAccessor
)
=>
{
changeAccessor
.
deltaDecorations
([
this
.
lin
eHighlightDecorationId
.
lineDecorationId
,
this
.
lineHighlightDecorationId
.
lin
eHighlightId
this
.
rang
eHighlightDecorationId
.
lineDecorationId
,
this
.
rangeHighlightDecorationId
.
rang
eHighlightId
],
[]);
});
}
});
this
.
lin
eHighlightDecorationId
=
null
;
this
.
rang
eHighlightDecorationId
=
null
;
}
}
...
...
src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts
浏览文件 @
49b07391
...
...
@@ -363,14 +363,14 @@ interface Outline {
}
interface
IEditorLineDecoration
{
lin
eHighlightId
:
string
;
rang
eHighlightId
:
string
;
lineDecorationId
:
string
;
position
:
Position
;
}
export
class
GotoSymbolHandler
extends
QuickOpenHandler
{
private
outlineToModelCache
:
{
[
modelId
:
string
]:
OutlineModel
;
};
private
lin
eHighlightDecorationId
:
IEditorLineDecoration
;
private
rang
eHighlightDecorationId
:
IEditorLineDecoration
;
private
lastKnownEditorViewState
:
IEditorViewState
;
private
activeOutlineRequest
:
TPromise
<
OutlineModel
>
;
...
...
@@ -509,19 +509,19 @@ export class GotoSymbolHandler extends QuickOpenHandler {
editor
.
changeDecorations
((
changeAccessor
:
IModelDecorationsChangeAccessor
)
=>
{
let
deleteDecorations
:
string
[]
=
[];
if
(
this
.
lin
eHighlightDecorationId
)
{
deleteDecorations
.
push
(
this
.
lin
eHighlightDecorationId
.
lineDecorationId
);
deleteDecorations
.
push
(
this
.
lineHighlightDecorationId
.
lin
eHighlightId
);
this
.
lin
eHighlightDecorationId
=
null
;
if
(
this
.
rang
eHighlightDecorationId
)
{
deleteDecorations
.
push
(
this
.
rang
eHighlightDecorationId
.
lineDecorationId
);
deleteDecorations
.
push
(
this
.
rangeHighlightDecorationId
.
rang
eHighlightId
);
this
.
rang
eHighlightDecorationId
=
null
;
}
let
newDecorations
:
IModelDeltaDecoration
[]
=
[
//
lin
eHighlight at index 0
//
rang
eHighlight at index 0
{
range
:
fullRange
,
options
:
{
className
:
'
lin
eHighlight
'
,
className
:
'
rang
eHighlight
'
,
isWholeLine
:
true
}
},
...
...
@@ -541,11 +541,11 @@ export class GotoSymbolHandler extends QuickOpenHandler {
];
let
decorations
=
changeAccessor
.
deltaDecorations
(
deleteDecorations
,
newDecorations
);
let
lin
eHighlightId
=
decorations
[
0
];
let
rang
eHighlightId
=
decorations
[
0
];
let
lineDecorationId
=
decorations
[
1
];
this
.
lin
eHighlightDecorationId
=
{
lineHighlightId
:
lin
eHighlightId
,
this
.
rang
eHighlightDecorationId
=
{
rangeHighlightId
:
rang
eHighlightId
,
lineDecorationId
:
lineDecorationId
,
position
:
position
};
...
...
@@ -553,20 +553,20 @@ export class GotoSymbolHandler extends QuickOpenHandler {
}
public
clearDecorations
():
void
{
if
(
this
.
lin
eHighlightDecorationId
)
{
if
(
this
.
rang
eHighlightDecorationId
)
{
this
.
editorService
.
getVisibleEditors
().
forEach
((
editor
)
=>
{
if
(
editor
.
position
===
this
.
lin
eHighlightDecorationId
.
position
)
{
if
(
editor
.
position
===
this
.
rang
eHighlightDecorationId
.
position
)
{
let
editorControl
=
<
IEditor
>
editor
.
getControl
();
editorControl
.
changeDecorations
((
changeAccessor
:
IModelDecorationsChangeAccessor
)
=>
{
changeAccessor
.
deltaDecorations
([
this
.
lin
eHighlightDecorationId
.
lineDecorationId
,
this
.
lineHighlightDecorationId
.
lin
eHighlightId
this
.
rang
eHighlightDecorationId
.
lineDecorationId
,
this
.
rangeHighlightDecorationId
.
rang
eHighlightId
],
[]);
});
}
});
this
.
lin
eHighlightDecorationId
=
null
;
this
.
rang
eHighlightDecorationId
=
null
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录