Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7fddf0f1
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,发现更多精彩内容 >>
提交
7fddf0f1
编写于
3月 04, 2020
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
line decorations for first and last line
上级
539f0f1e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
38 addition
and
6 deletion
+38
-6
src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.ts
...or/browser/viewParts/linesDecorations/linesDecorations.ts
+11
-3
src/vs/editor/common/model.ts
src/vs/editor/common/model.ts
+8
-0
src/vs/editor/common/model/textModel.ts
src/vs/editor/common/model/textModel.ts
+4
-0
src/vs/editor/contrib/folding/foldingDecorations.ts
src/vs/editor/contrib/folding/foldingDecorations.ts
+7
-3
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+8
-0
未找到文件。
src/vs/editor/browser/viewParts/linesDecorations/linesDecorations.ts
浏览文件 @
7fddf0f1
...
...
@@ -74,9 +74,17 @@ export class LinesDecorationsOverlay extends DedupOverlay {
let
r
:
DecorationToRender
[]
=
[],
rLen
=
0
;
for
(
let
i
=
0
,
len
=
decorations
.
length
;
i
<
len
;
i
++
)
{
const
d
=
decorations
[
i
];
const
linesDecorationsClassName
=
d
.
options
.
linesDecorationsClassName
;
if
(
linesDecorationsClassName
)
{
r
[
rLen
++
]
=
new
DecorationToRender
(
d
.
range
.
startLineNumber
,
d
.
range
.
endLineNumber
,
linesDecorationsClassName
);
const
linesDecorations
=
d
.
options
.
linesDecorationsClassName
;
if
(
linesDecorations
)
{
r
[
rLen
++
]
=
new
DecorationToRender
(
d
.
range
.
startLineNumber
,
d
.
range
.
endLineNumber
,
linesDecorations
);
}
const
firstLineDecorationsClassName
=
d
.
options
.
firstLineDecorationsClassName
;
if
(
firstLineDecorationsClassName
)
{
r
[
rLen
++
]
=
new
DecorationToRender
(
d
.
range
.
startLineNumber
,
d
.
range
.
startLineNumber
,
firstLineDecorationsClassName
);
}
const
lastLineDecorationsClassName
=
d
.
options
.
lastLineDecorationsClassName
;
if
(
lastLineDecorationsClassName
)
{
r
[
rLen
++
]
=
new
DecorationToRender
(
d
.
range
.
endLineNumber
,
d
.
range
.
endLineNumber
,
lastLineDecorationsClassName
);
}
}
return
r
;
...
...
src/vs/editor/common/model.ts
浏览文件 @
7fddf0f1
...
...
@@ -123,6 +123,14 @@ export interface IModelDecorationOptions {
* If set, the decoration will be rendered in the lines decorations with this CSS class name.
*/
linesDecorationsClassName
?:
string
|
null
;
/**
* If set, the decoration will be rendered for first line of the range in the lines decorations with this CSS class name.
*/
firstLineDecorationsClassName
?:
string
|
null
;
/**
* If set, the decoration will be rendered for last line of the range in the lines decorations for last line with this CSS class name.
*/
lastLineDecorationsClassName
?:
string
|
null
;
/**
* If set, the decoration will be rendered in the margin (covering its full width) with this CSS class name.
*/
...
...
src/vs/editor/common/model/textModel.ts
浏览文件 @
7fddf0f1
...
...
@@ -3053,6 +3053,8 @@ export class ModelDecorationOptions implements model.IModelDecorationOptions {
readonly
minimap
:
ModelDecorationMinimapOptions
|
null
;
readonly
glyphMarginClassName
:
string
|
null
;
readonly
linesDecorationsClassName
:
string
|
null
;
readonly
firstLineDecorationsClassName
:
string
|
null
;
readonly
lastLineDecorationsClassName
:
string
|
null
;
readonly
marginClassName
:
string
|
null
;
readonly
inlineClassName
:
string
|
null
;
readonly
inlineClassNameAffectsLetterSpacing
:
boolean
;
...
...
@@ -3072,6 +3074,8 @@ export class ModelDecorationOptions implements model.IModelDecorationOptions {
this
.
minimap
=
options
.
minimap
?
new
ModelDecorationMinimapOptions
(
options
.
minimap
)
:
null
;
this
.
glyphMarginClassName
=
options
.
glyphMarginClassName
?
cleanClassName
(
options
.
glyphMarginClassName
)
:
null
;
this
.
linesDecorationsClassName
=
options
.
linesDecorationsClassName
?
cleanClassName
(
options
.
linesDecorationsClassName
)
:
null
;
this
.
firstLineDecorationsClassName
=
options
.
firstLineDecorationsClassName
?
cleanClassName
(
options
.
firstLineDecorationsClassName
)
:
null
;
this
.
lastLineDecorationsClassName
=
options
.
lastLineDecorationsClassName
?
cleanClassName
(
options
.
lastLineDecorationsClassName
)
:
null
;
this
.
marginClassName
=
options
.
marginClassName
?
cleanClassName
(
options
.
marginClassName
)
:
null
;
this
.
inlineClassName
=
options
.
inlineClassName
?
cleanClassName
(
options
.
inlineClassName
)
:
null
;
this
.
inlineClassNameAffectsLetterSpacing
=
options
.
inlineClassNameAffectsLetterSpacing
||
false
;
...
...
src/vs/editor/contrib/folding/foldingDecorations.ts
浏览文件 @
7fddf0f1
...
...
@@ -13,7 +13,8 @@ export class FoldingDecorationProvider implements IDecorationProvider {
private
static
readonly
COLLAPSED_VISUAL_DECORATION
=
ModelDecorationOptions
.
register
({
stickiness
:
TrackedRangeStickiness
.
NeverGrowsWhenTypingAtEdges
,
afterContentClassName
:
'
inline-folded
'
,
linesDecorationsClassName
:
'
codicon codicon-chevron-right
'
isWholeLine
:
true
,
firstLineDecorationsClassName
:
'
codicon codicon-chevron-right
'
});
private
static
readonly
COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION
=
ModelDecorationOptions
.
register
({
...
...
@@ -21,16 +22,19 @@ export class FoldingDecorationProvider implements IDecorationProvider {
afterContentClassName
:
'
inline-folded
'
,
className
:
'
folded-background
'
,
isWholeLine
:
true
,
lines
DecorationsClassName
:
'
codicon codicon-chevron-right
'
firstLine
DecorationsClassName
:
'
codicon codicon-chevron-right
'
});
private
static
readonly
EXPANDED_AUTO_HIDE_VISUAL_DECORATION
=
ModelDecorationOptions
.
register
({
stickiness
:
TrackedRangeStickiness
.
NeverGrowsWhenTypingAtEdges
,
linesDecorationsClassName
:
'
codicon codicon-chevron-down
'
isWholeLine
:
true
,
firstLineDecorationsClassName
:
'
codicon codicon-chevron-down
'
});
private
static
readonly
EXPANDED_VISUAL_DECORATION
=
ModelDecorationOptions
.
register
({
stickiness
:
TrackedRangeStickiness
.
NeverGrowsWhenTypingAtEdges
,
isWholeLine
:
true
,
firstLineDecorationsClassName
:
'
codicon codicon-chevron-down alwaysShowFoldIcons
'
});
private
static
readonly
HIDDEN_RANGE_DECORATION
=
ModelDecorationOptions
.
register
({
...
...
src/vs/monaco.d.ts
浏览文件 @
7fddf0f1
...
...
@@ -1369,6 +1369,14 @@ declare namespace monaco.editor {
* If set, the decoration will be rendered in the lines decorations with this CSS class name.
*/
linesDecorationsClassName
?:
string
|
null
;
/**
* If set, the decoration will be rendered for first line of the range in the lines decorations with this CSS class name.
*/
firstLineDecorationsClassName
?:
string
|
null
;
/**
* If set, the decoration will be rendered for last line of the range in the lines decorations for last line with this CSS class name.
*/
lastLineDecorationsClassName
?:
string
|
null
;
/**
* If set, the decoration will be rendered in the margin (covering its full width) with this CSS class name.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录