Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
519ceb62
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,发现更多精彩内容 >>
未验证
提交
519ceb62
编写于
1月 13, 2020
作者:
A
Alexandru Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Respect editor.wrappingAlgorithm
上级
53125e31
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
13 deletion
+22
-13
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+2
-1
src/vs/editor/common/viewModel/splitLinesCollection.ts
src/vs/editor/common/viewModel/splitLinesCollection.ts
+12
-9
src/vs/editor/common/viewModel/viewModelImpl.ts
src/vs/editor/common/viewModel/viewModelImpl.ts
+6
-3
src/vs/editor/test/common/viewModel/splitLinesCollection.test.ts
...editor/test/common/viewModel/splitLinesCollection.test.ts
+2
-0
未找到文件。
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
519ceb62
...
...
@@ -3730,7 +3730,8 @@ export const EditorOptions = {
)),
wrappingAlgorithm
:
register
(
new
EditorStringEnumOption
(
EditorOption
.
wrappingAlgorithm
,
'
wrappingAlgorithm
'
,
'
monospace
'
,
[
'
monospace
'
,
'
dom
'
],
'
monospace
'
as
'
monospace
'
|
'
dom
'
,
[
'
monospace
'
,
'
dom
'
]
as
const
,
{
enumDescriptions
:
[
nls
.
localize
(
'
wrappingAlgorithm.monospace
'
,
"
Assumes that all characters are of the same width. This is a fast algorithm.
"
),
...
...
src/vs/editor/common/viewModel/splitLinesCollection.ts
浏览文件 @
519ceb62
...
...
@@ -109,7 +109,7 @@ export interface ISplitLine {
export
interface
IViewModelLinesCollection
extends
IDisposable
{
createCoordinatesConverter
():
ICoordinatesConverter
;
setWrappingSettings
(
fontInfo
:
FontInfo
,
wrappingColumn
:
number
,
wrappingIndent
:
WrappingIndent
):
boolean
;
setWrappingSettings
(
fontInfo
:
FontInfo
,
wrapping
Algorithm
:
'
monospace
'
|
'
dom
'
,
wrapping
Column
:
number
,
wrappingIndent
:
WrappingIndent
):
boolean
;
setTabSize
(
newTabSize
:
number
):
boolean
;
getHiddenAreas
():
Range
[];
setHiddenAreas
(
_ranges
:
Range
[]):
boolean
;
...
...
@@ -265,8 +265,6 @@ class LineNumberMapper {
}
}
const
usDOMLineBreaksComputerFactory
=
false
;
export
class
SplitLinesCollection
implements
IViewModelLinesCollection
{
private
readonly
model
:
ITextModel
;
...
...
@@ -279,6 +277,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
private
tabSize
:
number
;
private
wrappingColumn
:
number
;
private
wrappingIndent
:
WrappingIndent
;
private
wrappingAlgorithm
:
'
monospace
'
|
'
dom
'
;
private
lines
!
:
ISplitLine
[];
private
prefixSumComputer
!
:
LineNumberMapper
;
...
...
@@ -291,8 +290,9 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
monospaceLineBreaksComputerFactory
:
ILineBreaksComputerFactory
,
fontInfo
:
FontInfo
,
tabSize
:
number
,
wrappingAlgorithm
:
'
monospace
'
|
'
dom
'
,
wrappingColumn
:
number
,
wrappingIndent
:
WrappingIndent
wrappingIndent
:
WrappingIndent
,
)
{
this
.
model
=
model
;
this
.
_validModelVersionId
=
-
1
;
...
...
@@ -300,6 +300,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
this
.
_monospaceLineBreaksComputerFactory
=
monospaceLineBreaksComputerFactory
;
this
.
fontInfo
=
fontInfo
;
this
.
tabSize
=
tabSize
;
this
.
wrappingAlgorithm
=
wrappingAlgorithm
;
this
.
wrappingColumn
=
wrappingColumn
;
this
.
wrappingIndent
=
wrappingIndent
;
...
...
@@ -483,17 +484,19 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
return
true
;
}
public
setWrappingSettings
(
fontInfo
:
FontInfo
,
wrappingColumn
:
number
,
wrappingIndent
:
WrappingIndent
):
boolean
{
public
setWrappingSettings
(
fontInfo
:
FontInfo
,
wrapping
Algorithm
:
'
monospace
'
|
'
dom
'
,
wrapping
Column
:
number
,
wrappingIndent
:
WrappingIndent
):
boolean
{
const
equalFontInfo
=
this
.
fontInfo
.
equals
(
fontInfo
);
const
equalWrappingAlgorithm
=
(
this
.
wrappingAlgorithm
===
wrappingAlgorithm
);
const
equalWrappingColumn
=
(
this
.
wrappingColumn
===
wrappingColumn
);
const
equalWrappingIndent
=
(
this
.
wrappingIndent
===
wrappingIndent
);
if
(
equalFontInfo
&&
equalWrappingColumn
&&
equalWrappingIndent
)
{
if
(
equalFontInfo
&&
equalWrapping
Algorithm
&&
equalWrapping
Column
&&
equalWrappingIndent
)
{
return
false
;
}
const
onlyWrappingColumnChanged
=
(
equalFontInfo
&&
!
equalWrappingColumn
&&
equalWrappingIndent
);
const
onlyWrappingColumnChanged
=
(
equalFontInfo
&&
equalWrappingAlgorithm
&&
!
equalWrappingColumn
&&
equalWrappingIndent
);
this
.
fontInfo
=
fontInfo
;
this
.
wrappingAlgorithm
=
wrappingAlgorithm
;
this
.
wrappingColumn
=
wrappingColumn
;
this
.
wrappingIndent
=
wrappingIndent
;
...
...
@@ -512,7 +515,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
public
createLineBreaksComputer
():
ILineBreaksComputer
{
const
lineBreaksComputerFactory
=
(
usDOMLineBreaksComputerFactory
this
.
wrappingAlgorithm
===
'
dom
'
?
this
.
_domLineBreaksComputerFactory
:
this
.
_monospaceLineBreaksComputerFactory
);
...
...
@@ -1457,7 +1460,7 @@ export class IdentityLinesCollection implements IViewModelLinesCollection {
return
false
;
}
public
setWrappingSettings
(
_fontInfo
:
FontInfo
,
_wrappingColumn
:
number
,
_wrappingIndent
:
WrappingIndent
):
boolean
{
public
setWrappingSettings
(
_fontInfo
:
FontInfo
,
_wrapping
Algorithm
:
'
monospace
'
|
'
dom
'
,
_wrapping
Column
:
number
,
_wrappingIndent
:
WrappingIndent
):
boolean
{
return
false
;
}
...
...
src/vs/editor/common/viewModel/viewModelImpl.ts
浏览文件 @
519ceb62
...
...
@@ -67,8 +67,9 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel
}
else
{
const
options
=
this
.
configuration
.
options
;
const
wrappingInfo
=
options
.
get
(
EditorOption
.
wrappingInfo
);
const
fontInfo
=
options
.
get
(
EditorOption
.
fontInfo
);
const
wrappingAlgorithm
=
options
.
get
(
EditorOption
.
wrappingAlgorithm
);
const
wrappingInfo
=
options
.
get
(
EditorOption
.
wrappingInfo
);
const
wrappingIndent
=
options
.
get
(
EditorOption
.
wrappingIndent
);
this
.
lines
=
new
SplitLinesCollection
(
...
...
@@ -77,6 +78,7 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel
monospaceLineBreaksComputerFactory
,
fontInfo
,
this
.
model
.
getOptions
().
tabSize
,
wrappingAlgorithm
,
wrappingInfo
.
wrappingColumn
,
wrappingIndent
);
...
...
@@ -153,11 +155,12 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel
let
restorePreviousViewportStart
=
false
;
const
options
=
this
.
configuration
.
options
;
const
wrappingInfo
=
options
.
get
(
EditorOption
.
wrappingInfo
);
const
fontInfo
=
options
.
get
(
EditorOption
.
fontInfo
);
const
wrappingAlgorithm
=
options
.
get
(
EditorOption
.
wrappingAlgorithm
);
const
wrappingInfo
=
options
.
get
(
EditorOption
.
wrappingInfo
);
const
wrappingIndent
=
options
.
get
(
EditorOption
.
wrappingIndent
);
if
(
this
.
lines
.
setWrappingSettings
(
fontInfo
,
wrappingInfo
.
wrappingColumn
,
wrappingIndent
))
{
if
(
this
.
lines
.
setWrappingSettings
(
fontInfo
,
wrapping
Algorithm
,
wrapping
Info
.
wrappingColumn
,
wrappingIndent
))
{
eventsCollector
.
emit
(
new
viewEvents
.
ViewFlushedEvent
());
eventsCollector
.
emit
(
new
viewEvents
.
ViewLineMappingChangedEvent
());
eventsCollector
.
emit
(
new
viewEvents
.
ViewDecorationsChangedEvent
());
...
...
src/vs/editor/test/common/viewModel/splitLinesCollection.test.ts
浏览文件 @
519ceb62
...
...
@@ -111,6 +111,7 @@ suite('Editor ViewModel - SplitLinesCollection', () => {
lineBreaksComputerFactory
,
fontInfo
,
model
.
getOptions
().
tabSize
,
'
monospace
'
,
wrappingInfo
.
wrappingColumn
,
wrappingIndent
);
...
...
@@ -752,6 +753,7 @@ suite('SplitLinesCollection', () => {
lineBreaksComputerFactory
,
fontInfo
,
model
.
getOptions
().
tabSize
,
'
monospace
'
,
wrappingInfo
.
wrappingColumn
,
wrappingIndent
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录