Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
e4544962
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,发现更多精彩内容 >>
未验证
提交
e4544962
编写于
6月 21, 2018
作者:
A
Alexandru Dima
提交者:
GitHub
6月 21, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #49298 from CoenraadS/highlightActiveIndentGuide
Add setting for highlightActiveIndentGuide #49148
上级
7a42b91d
ac7fcc94
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
27 addition
and
3 deletion
+27
-3
src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts
src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts
+4
-1
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+5
-0
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+11
-1
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+7
-1
未找到文件。
src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts
浏览文件 @
e4544962
...
...
@@ -22,6 +22,7 @@ export class IndentGuidesOverlay extends DynamicViewOverlay {
private
_spaceWidth
:
number
;
private
_renderResult
:
string
[];
private
_enabled
:
boolean
;
private
_activeIndentEnabled
:
boolean
;
constructor
(
context
:
ViewContext
)
{
super
();
...
...
@@ -30,6 +31,7 @@ export class IndentGuidesOverlay extends DynamicViewOverlay {
this
.
_lineHeight
=
this
.
_context
.
configuration
.
editor
.
lineHeight
;
this
.
_spaceWidth
=
this
.
_context
.
configuration
.
editor
.
fontInfo
.
spaceWidth
;
this
.
_enabled
=
this
.
_context
.
configuration
.
editor
.
viewInfo
.
renderIndentGuides
;
this
.
_activeIndentEnabled
=
this
.
_context
.
configuration
.
editor
.
viewInfo
.
highlightActiveIndentGuide
;
this
.
_renderResult
=
null
;
this
.
_context
.
addEventHandler
(
this
);
...
...
@@ -53,6 +55,7 @@ export class IndentGuidesOverlay extends DynamicViewOverlay {
}
if
(
e
.
viewInfo
)
{
this
.
_enabled
=
this
.
_context
.
configuration
.
editor
.
viewInfo
.
renderIndentGuides
;
this
.
_activeIndentEnabled
=
this
.
_context
.
configuration
.
editor
.
viewInfo
.
highlightActiveIndentGuide
;
}
return
true
;
}
...
...
@@ -114,7 +117,7 @@ export class IndentGuidesOverlay extends DynamicViewOverlay {
let
activeIndentStartLineNumber
=
0
;
let
activeIndentEndLineNumber
=
0
;
let
activeIndentLevel
=
0
;
if
(
this
.
_primaryLineNumber
)
{
if
(
this
.
_
activeIndentEnabled
&&
this
.
_
primaryLineNumber
)
{
const
activeIndentInfo
=
this
.
_context
.
model
.
getActiveIndentGuide
(
this
.
_primaryLineNumber
,
visibleStartLineNumber
,
visibleEndLineNumber
);
activeIndentStartLineNumber
=
activeIndentInfo
.
startLineNumber
;
activeIndentEndLineNumber
=
activeIndentInfo
.
endLineNumber
;
...
...
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
e4544962
...
...
@@ -572,6 +572,11 @@ const editorConfiguration: IConfigurationNode = {
default
:
EDITOR_DEFAULTS
.
viewInfo
.
renderIndentGuides
,
description
:
nls
.
localize
(
'
renderIndentGuides
'
,
"
Controls whether the editor should render indent guides
"
)
},
'
editor.highlightActiveIndentGuide
'
:
{
'
type
'
:
'
boolean
'
,
default
:
EDITOR_DEFAULTS
.
viewInfo
.
highlightActiveIndentGuide
,
description
:
nls
.
localize
(
'
highlightActiveIndentGuide
'
,
"
Controls whether the editor should highlight the active indent guide
"
)
},
'
editor.renderLineHighlight
'
:
{
'
type
'
:
'
string
'
,
'
enum
'
:
[
'
none
'
,
'
gutter
'
,
'
line
'
,
'
all
'
],
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
e4544962
...
...
@@ -549,9 +549,14 @@ export interface IEditorOptions {
renderControlCharacters
?:
boolean
;
/**
* Enable rendering of indent guides.
* Defaults to
fals
e.
* Defaults to
tru
e.
*/
renderIndentGuides
?:
boolean
;
/**
* Enable highlighting of the active indent guide.
* Defaults to true.
*/
highlightActiveIndentGuide
?:
boolean
;
/**
* Enable rendering of current line highlight.
* Defaults to all.
...
...
@@ -845,6 +850,7 @@ export interface InternalEditorViewOptions {
readonly
renderControlCharacters
:
boolean
;
readonly
fontLigatures
:
boolean
;
readonly
renderIndentGuides
:
boolean
;
readonly
highlightActiveIndentGuide
:
boolean
;
readonly
renderLineHighlight
:
'
none
'
|
'
gutter
'
|
'
line
'
|
'
all
'
;
readonly
scrollbar
:
InternalEditorScrollbarOptions
;
readonly
minimap
:
InternalEditorMinimapOptions
;
...
...
@@ -1131,6 +1137,7 @@ export class InternalEditorOptions {
&&
a
.
renderControlCharacters
===
b
.
renderControlCharacters
&&
a
.
fontLigatures
===
b
.
fontLigatures
&&
a
.
renderIndentGuides
===
b
.
renderIndentGuides
&&
a
.
highlightActiveIndentGuide
===
b
.
highlightActiveIndentGuide
&&
a
.
renderLineHighlight
===
b
.
renderLineHighlight
&&
this
.
_equalsScrollbarOptions
(
a
.
scrollbar
,
b
.
scrollbar
)
&&
this
.
_equalsMinimapOptions
(
a
.
minimap
,
b
.
minimap
)
...
...
@@ -1748,6 +1755,7 @@ export class EditorOptionsValidator {
renderControlCharacters
:
_boolean
(
opts
.
renderControlCharacters
,
defaults
.
renderControlCharacters
),
fontLigatures
:
fontLigatures
,
renderIndentGuides
:
_boolean
(
opts
.
renderIndentGuides
,
defaults
.
renderIndentGuides
),
highlightActiveIndentGuide
:
_boolean
(
opts
.
highlightActiveIndentGuide
,
defaults
.
highlightActiveIndentGuide
),
renderLineHighlight
:
renderLineHighlight
,
scrollbar
:
scrollbar
,
minimap
:
minimap
,
...
...
@@ -1862,6 +1870,7 @@ export class InternalEditorOptionsFactory {
renderControlCharacters
:
(
accessibilityIsOn
?
false
:
opts
.
viewInfo
.
renderControlCharacters
),
// DISABLED WHEN SCREEN READER IS ATTACHED
fontLigatures
:
(
accessibilityIsOn
?
false
:
opts
.
viewInfo
.
fontLigatures
),
// DISABLED WHEN SCREEN READER IS ATTACHED
renderIndentGuides
:
(
accessibilityIsOn
?
false
:
opts
.
viewInfo
.
renderIndentGuides
),
// DISABLED WHEN SCREEN READER IS ATTACHED
highlightActiveIndentGuide
:
opts
.
viewInfo
.
highlightActiveIndentGuide
,
renderLineHighlight
:
opts
.
viewInfo
.
renderLineHighlight
,
scrollbar
:
opts
.
viewInfo
.
scrollbar
,
minimap
:
{
...
...
@@ -2315,6 +2324,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
renderControlCharacters
:
false
,
fontLigatures
:
false
,
renderIndentGuides
:
true
,
highlightActiveIndentGuide
:
true
,
renderLineHighlight
:
'
line
'
,
scrollbar
:
{
vertical
:
ScrollbarVisibility
.
Auto
,
...
...
src/vs/monaco.d.ts
浏览文件 @
e4544962
...
...
@@ -2891,9 +2891,14 @@ declare namespace monaco.editor {
renderControlCharacters
?:
boolean
;
/**
* Enable rendering of indent guides.
* Defaults to
fals
e.
* Defaults to
tru
e.
*/
renderIndentGuides
?:
boolean
;
/**
* Enable highlighting of the active indent guide.
* Defaults to true.
*/
highlightActiveIndentGuide
?:
boolean
;
/**
* Enable rendering of current line highlight.
* Defaults to all.
...
...
@@ -3124,6 +3129,7 @@ declare namespace monaco.editor {
readonly
renderControlCharacters
:
boolean
;
readonly
fontLigatures
:
boolean
;
readonly
renderIndentGuides
:
boolean
;
readonly
highlightActiveIndentGuide
:
boolean
;
readonly
renderLineHighlight
:
'
none
'
|
'
gutter
'
|
'
line
'
|
'
all
'
;
readonly
scrollbar
:
InternalEditorScrollbarOptions
;
readonly
minimap
:
InternalEditorMinimapOptions
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录