Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
94428f89
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,发现更多精彩内容 >>
未验证
提交
94428f89
编写于
5月 12, 2020
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #95685: Use Unicode replacement character for all unusual line terminators
上级
7a424f60
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
51 addition
and
5 deletion
+51
-5
src/vs/base/common/charCode.ts
src/vs/base/common/charCode.ts
+12
-2
src/vs/editor/browser/view/domLineBreaksComputer.ts
src/vs/editor/browser/view/domLineBreaksComputer.ts
+3
-1
src/vs/editor/common/modes/textToHtmlTokenizer.ts
src/vs/editor/common/modes/textToHtmlTokenizer.ts
+3
-1
src/vs/editor/common/viewLayout/viewLineRenderer.ts
src/vs/editor/common/viewLayout/viewLineRenderer.ts
+3
-1
src/vs/editor/test/common/viewLayout/viewLineRenderer.test.ts
...vs/editor/test/common/viewLayout/viewLineRenderer.test.ts
+30
-0
未找到文件。
src/vs/base/common/charCode.ts
浏览文件 @
94428f89
...
...
@@ -342,7 +342,17 @@ export const enum CharCode {
* Unicode Character 'LINE SEPARATOR' (U+2028)
* http://www.fileformat.info/info/unicode/char/2028/index.htm
*/
LINE_SEPARATOR_2028
=
8232
,
LINE_SEPARATOR
=
0x2028
,
/**
* Unicode Character 'PARAGRAPH SEPARATOR' (U+2029)
* http://www.fileformat.info/info/unicode/char/2029/index.htm
*/
PARAGRAPH_SEPARATOR
=
0x2029
,
/**
* Unicode Character 'NEXT LINE' (U+0085)
* http://www.fileformat.info/info/unicode/char/0085/index.htm
*/
NEXT_LINE
=
0x0085
,
// http://www.fileformat.info/info/unicode/category/Sk/list.htm
U_CIRCUMFLEX
=
0x005E
,
// U+005E CIRCUMFLEX
...
...
@@ -422,4 +432,4 @@ export const enum CharCode {
* http://www.fileformat.info/info/unicode/char/feff/index.htm
*/
UTF8_BOM
=
65279
}
\ No newline at end of file
}
src/vs/editor/browser/view/domLineBreaksComputer.ts
浏览文件 @
94428f89
...
...
@@ -217,7 +217,9 @@ function renderLine(lineContent: string, initialVisibleColumn: number, tabSize:
break
;
case
CharCode
.
UTF8_BOM
:
case
CharCode
.
LINE_SEPARATOR_2028
:
case
CharCode
.
LINE_SEPARATOR
:
case
CharCode
.
PARAGRAPH_SEPARATOR
:
case
CharCode
.
NEXT_LINE
:
sb
.
write1
(
0xFFFD
);
break
;
...
...
src/vs/editor/common/modes/textToHtmlTokenizer.ts
浏览文件 @
94428f89
...
...
@@ -68,7 +68,9 @@ export function tokenizeLineToHTML(text: string, viewLineTokens: IViewLineTokens
break
;
case
CharCode
.
UTF8_BOM
:
case
CharCode
.
LINE_SEPARATOR_2028
:
case
CharCode
.
LINE_SEPARATOR
:
case
CharCode
.
PARAGRAPH_SEPARATOR
:
case
CharCode
.
NEXT_LINE
:
partContent
+=
'
\
ufffd
'
;
break
;
...
...
src/vs/editor/common/viewLayout/viewLineRenderer.ts
浏览文件 @
94428f89
...
...
@@ -934,7 +934,9 @@ function _renderLine(input: ResolvedRenderLineInput, sb: IStringBuilder): Render
break
;
case
CharCode
.
UTF8_BOM
:
case
CharCode
.
LINE_SEPARATOR_2028
:
case
CharCode
.
LINE_SEPARATOR
:
case
CharCode
.
PARAGRAPH_SEPARATOR
:
case
CharCode
.
NEXT_LINE
:
sb
.
write1
(
0xFFFD
);
break
;
...
...
src/vs/editor/test/common/viewLayout/viewLineRenderer.test.ts
浏览文件 @
94428f89
...
...
@@ -703,6 +703,36 @@ suite('viewLineRenderer.renderLine', () => {
assert
.
equal
(
actual
.
containsRTL
,
true
);
});
test
(
'
issue #95685: Uses unicode replacement character for Paragraph Separator
'
,
()
=>
{
const
lineText
=
'
var ftext = [
\
u2029"Und", "dann", "eines"];
'
;
const
lineParts
=
createViewLineTokens
([
createPart
(
lineText
.
length
,
1
)]);
const
expectedOutput
=
[
'
<span class="mtk1">var
\
u00a0ftext
\
u00a0=
\
u00a0[
\
uFFFD"Und",
\
u00a0"dann",
\
u00a0"eines"];</span>
'
];
const
actual
=
renderViewLine
(
new
RenderLineInput
(
false
,
true
,
lineText
,
false
,
false
,
false
,
0
,
lineParts
,
[],
4
,
0
,
10
,
10
,
10
,
-
1
,
'
none
'
,
false
,
false
,
null
));
assert
.
equal
(
actual
.
html
,
'
<span>
'
+
expectedOutput
.
join
(
''
)
+
'
</span>
'
);
});
test
(
'
issue #19673: Monokai Theme bad-highlighting in line wrap
'
,
()
=>
{
let
lineText
=
'
MongoCallback<string>): void {
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录