Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
e7a83983
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,发现更多精彩内容 >>
提交
e7a83983
编写于
3月 15, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #4153: Leave a 1px gap between distinct selections
上级
802fef3f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
11 deletion
+21
-11
src/vs/editor/browser/viewParts/selections/selections.ts
src/vs/editor/browser/viewParts/selections/selections.ts
+21
-11
未找到文件。
src/vs/editor/browser/viewParts/selections/selections.ts
浏览文件 @
e7a83983
...
...
@@ -285,10 +285,12 @@ export class SelectionsOverlay extends ViewEventHandler implements IDynamicViewO
return
linesVisibleRanges
;
}
private
_createSelectionPiece
(
lineOutput
:
string
[],
height
:
string
,
className
:
string
,
left
:
number
,
width
:
number
):
void
{
private
_createSelectionPiece
(
lineOutput
:
string
[],
top
:
number
,
height
:
string
,
className
:
string
,
left
:
number
,
width
:
number
):
void
{
lineOutput
.
push
(
'
<div class="cslr
'
);
lineOutput
.
push
(
className
);
lineOutput
.
push
(
'
" style="left:
'
);
lineOutput
.
push
(
'
" style="top:
'
);
lineOutput
.
push
(
top
.
toString
());
lineOutput
.
push
(
'
px;left:
'
);
lineOutput
.
push
(
left
.
toString
());
lineOutput
.
push
(
'
px;width:
'
);
lineOutput
.
push
(
width
.
toString
());
...
...
@@ -302,20 +304,28 @@ export class SelectionsOverlay extends ViewEventHandler implements IDynamicViewO
lineVisibleRanges
:
LineVisibleRangesWithStyle
,
lineOutput
:
string
[],
className
:
string
,
lineHeight
=
this
.
_context
.
configuration
.
editor
.
lineHeight
.
toString
(),
fullLineHeight
=
(
this
.
_context
.
configuration
.
editor
.
lineHeight
).
toString
(),
reducedLineHeight
=
(
this
.
_context
.
configuration
.
editor
.
lineHeight
-
1
).
toString
(),
i
:
number
,
len
:
number
,
j
:
number
,
lenJ
:
number
,
piecesCount
=
0
,
visibleRange
:
HorizontalRangeWithStyle
;
let
firstLineNumber
=
(
visibleRanges
.
length
>
0
?
visibleRanges
[
0
].
lineNumber
:
0
);
let
lastLineNumber
=
(
visibleRanges
.
length
>
0
?
visibleRanges
[
visibleRanges
.
length
-
1
].
lineNumber
:
0
);
for
(
i
=
0
,
len
=
visibleRanges
.
length
;
i
<
len
;
i
++
)
{
lineVisibleRanges
=
visibleRanges
[
i
];
let
lineNumber
=
lineVisibleRanges
.
lineNumber
;
let
lineHeight
=
(
lineNumber
===
lastLineNumber
||
lineNumber
===
firstLineNumber
?
reducedLineHeight
:
fullLineHeight
);
let
top
=
(
lineNumber
===
firstLineNumber
?
1
:
0
);
if
(
output
.
hasOwnProperty
(
line
VisibleRanges
.
line
Number
.
toString
()))
{
lineOutput
=
output
[
line
VisibleRanges
.
line
Number
.
toString
()];
if
(
output
.
hasOwnProperty
(
lineNumber
.
toString
()))
{
lineOutput
=
output
[
lineNumber
.
toString
()];
}
else
{
lineOutput
=
[];
output
[
line
VisibleRanges
.
line
Number
.
toString
()]
=
lineOutput
;
output
[
lineNumber
.
toString
()]
=
lineOutput
;
}
for
(
j
=
0
,
lenJ
=
lineVisibleRanges
.
ranges
.
length
;
j
<
lenJ
;
j
++
)
{
...
...
@@ -327,7 +337,7 @@ export class SelectionsOverlay extends ViewEventHandler implements IDynamicViewO
// First comes the selection (blue layer)
piecesCount
++
;
this
.
_createSelectionPiece
(
lineOutput
,
lineHeight
,
SelectionsOverlay
.
SELECTION_CLASS_NAME
,
visibleRange
.
left
-
SelectionsOverlay
.
ROUNDED_PIECE_WIDTH
,
SelectionsOverlay
.
ROUNDED_PIECE_WIDTH
);
this
.
_createSelectionPiece
(
lineOutput
,
top
,
lineHeight
,
SelectionsOverlay
.
SELECTION_CLASS_NAME
,
visibleRange
.
left
-
SelectionsOverlay
.
ROUNDED_PIECE_WIDTH
,
SelectionsOverlay
.
ROUNDED_PIECE_WIDTH
);
// Second comes the background (white layer) with inverse border radius
className
=
SelectionsOverlay
.
EDITOR_BACKGROUND_CLASS_NAME
;
...
...
@@ -338,14 +348,14 @@ export class SelectionsOverlay extends ViewEventHandler implements IDynamicViewO
className
+=
'
'
+
SelectionsOverlay
.
SELECTION_BOTTOM_RIGHT
;
}
piecesCount
++
;
this
.
_createSelectionPiece
(
lineOutput
,
lineHeight
,
className
,
visibleRange
.
left
-
SelectionsOverlay
.
ROUNDED_PIECE_WIDTH
,
SelectionsOverlay
.
ROUNDED_PIECE_WIDTH
);
this
.
_createSelectionPiece
(
lineOutput
,
top
,
lineHeight
,
className
,
visibleRange
.
left
-
SelectionsOverlay
.
ROUNDED_PIECE_WIDTH
,
SelectionsOverlay
.
ROUNDED_PIECE_WIDTH
);
}
if
(
visibleRange
.
endStyle
.
top
===
CornerStyle
.
INTERN
||
visibleRange
.
endStyle
.
bottom
===
CornerStyle
.
INTERN
)
{
// Reverse rounded corner to the right
// First comes the selection (blue layer)
piecesCount
++
;
this
.
_createSelectionPiece
(
lineOutput
,
lineHeight
,
SelectionsOverlay
.
SELECTION_CLASS_NAME
,
visibleRange
.
left
+
visibleRange
.
width
,
SelectionsOverlay
.
ROUNDED_PIECE_WIDTH
);
this
.
_createSelectionPiece
(
lineOutput
,
top
,
lineHeight
,
SelectionsOverlay
.
SELECTION_CLASS_NAME
,
visibleRange
.
left
+
visibleRange
.
width
,
SelectionsOverlay
.
ROUNDED_PIECE_WIDTH
);
// Second comes the background (white layer) with inverse border radius
className
=
SelectionsOverlay
.
EDITOR_BACKGROUND_CLASS_NAME
;
...
...
@@ -356,7 +366,7 @@ export class SelectionsOverlay extends ViewEventHandler implements IDynamicViewO
className
+=
'
'
+
SelectionsOverlay
.
SELECTION_BOTTOM_LEFT
;
}
piecesCount
++
;
this
.
_createSelectionPiece
(
lineOutput
,
lineHeight
,
className
,
visibleRange
.
left
+
visibleRange
.
width
,
SelectionsOverlay
.
ROUNDED_PIECE_WIDTH
);
this
.
_createSelectionPiece
(
lineOutput
,
top
,
lineHeight
,
className
,
visibleRange
.
left
+
visibleRange
.
width
,
SelectionsOverlay
.
ROUNDED_PIECE_WIDTH
);
}
}
...
...
@@ -376,7 +386,7 @@ export class SelectionsOverlay extends ViewEventHandler implements IDynamicViewO
}
}
piecesCount
++
;
this
.
_createSelectionPiece
(
lineOutput
,
lineHeight
,
className
,
visibleRange
.
left
,
visibleRange
.
width
);
this
.
_createSelectionPiece
(
lineOutput
,
top
,
lineHeight
,
className
,
visibleRange
.
left
,
visibleRange
.
width
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录