Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e89ea5c9
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,发现更多精彩内容 >>
提交
e89ea5c9
编写于
7月 22, 2019
作者:
P
pi1024e
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "respelling WhiteSpace as Whitespace, as Whitespace is one word"
This reverts commit d60b16c82e3ab83d6b1f2787a176d5a2e38b829b.
上级
467fe58c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
21 deletion
+20
-21
extensions/emmet/src/abbreviationActions.ts
extensions/emmet/src/abbreviationActions.ts
+4
-4
src/vs/base/common/json.ts
src/vs/base/common/json.ts
+5
-6
src/vs/editor/contrib/indentation/indentation.ts
src/vs/editor/contrib/indentation/indentation.ts
+3
-3
src/vs/editor/test/browser/controller/cursorMoveCommand.test.ts
.../editor/test/browser/controller/cursorMoveCommand.test.ts
+8
-8
未找到文件。
extensions/emmet/src/abbreviationActions.ts
浏览文件 @
e89ea5c9
...
...
@@ -84,8 +84,8 @@ function doWrapping(individualLines: boolean, args: any) {
const
firstLineOfSelection
=
editor
.
document
.
lineAt
(
rangeToReplace
.
start
).
text
.
substr
(
rangeToReplace
.
start
.
character
);
const
matches
=
firstLineOfSelection
.
match
(
/^
(\s
*
)
/
);
const
extraWhite
spav
eSelected
=
matches
?
matches
[
1
].
length
:
0
;
rangeToReplace
=
new
vscode
.
Range
(
rangeToReplace
.
start
.
line
,
rangeToReplace
.
start
.
character
+
extraWhite
spav
eSelected
,
rangeToReplace
.
end
.
line
,
rangeToReplace
.
end
.
character
);
const
extraWhite
Spac
eSelected
=
matches
?
matches
[
1
].
length
:
0
;
rangeToReplace
=
new
vscode
.
Range
(
rangeToReplace
.
start
.
line
,
rangeToReplace
.
start
.
character
+
extraWhite
Spac
eSelected
,
rangeToReplace
.
end
.
line
,
rangeToReplace
.
end
.
character
);
let
textToWrapInPreview
:
string
[];
let
textToReplace
=
editor
.
document
.
getText
(
rangeToReplace
);
...
...
@@ -94,8 +94,8 @@ function doWrapping(individualLines: boolean, args: any) {
}
else
{
const
wholeFirstLine
=
editor
.
document
.
lineAt
(
rangeToReplace
.
start
).
text
;
const
otherMatches
=
wholeFirstLine
.
match
(
/^
(\s
*
)
/
);
const
preceedingWhite
spav
e
=
otherMatches
?
otherMatches
[
1
]
:
''
;
textToWrapInPreview
=
rangeToReplace
.
isSingleLine
?
[
textToReplace
]
:
[
'
\n\t
'
+
textToReplace
.
split
(
'
\n
'
+
preceedingWhite
spav
e
).
join
(
'
\n\t
'
)
+
'
\n
'
];
const
preceedingWhite
Spac
e
=
otherMatches
?
otherMatches
[
1
]
:
''
;
textToWrapInPreview
=
rangeToReplace
.
isSingleLine
?
[
textToReplace
]
:
[
'
\n\t
'
+
textToReplace
.
split
(
'
\n
'
+
preceedingWhite
Spac
e
).
join
(
'
\n\t
'
)
+
'
\n
'
];
}
textToWrapInPreview
=
textToWrapInPreview
.
map
(
e
=>
e
.
replace
(
/
(\$\d)
/g
,
'
\\
$1
'
));
...
...
src/vs/base/common/json.ts
浏览文件 @
e89ea5c9
...
...
@@ -374,12 +374,12 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON
let
code
=
text
.
charCodeAt
(
pos
);
// trivia: whitespace
if
(
isWhite
spav
e
(
code
))
{
if
(
isWhite
Spac
e
(
code
))
{
do
{
pos
++
;
value
+=
String
.
fromCharCode
(
code
);
code
=
text
.
charCodeAt
(
pos
);
}
while
(
isWhite
spav
e
(
code
));
}
while
(
isWhite
Spac
e
(
code
));
return
token
=
SyntaxKind
.
Trivia
;
}
...
...
@@ -517,7 +517,7 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON
}
function
isUnknownContentCharacter
(
code
:
CharacterCodes
)
{
if
(
isWhite
spav
e
(
code
)
||
isLineBreak
(
code
))
{
if
(
isWhite
Spac
e
(
code
)
||
isLineBreak
(
code
))
{
return
false
;
}
switch
(
code
)
{
...
...
@@ -530,9 +530,8 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON
case
CharacterCodes
.
comma
:
case
CharacterCodes
.
slash
:
return
false
;
default
:
return
true
;
}
return
true
;
}
...
...
@@ -556,7 +555,7 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON
};
}
function
isWhite
spav
e
(
ch
:
number
):
boolean
{
function
isWhite
Spac
e
(
ch
:
number
):
boolean
{
return
ch
===
CharacterCodes
.
space
||
ch
===
CharacterCodes
.
tab
||
ch
===
CharacterCodes
.
verticalTab
||
ch
===
CharacterCodes
.
formFeed
||
ch
===
CharacterCodes
.
nonBreakingSpace
||
ch
===
CharacterCodes
.
ogham
||
ch
>=
CharacterCodes
.
enQuad
&&
ch
<=
CharacterCodes
.
zeroWidthSpace
||
ch
===
CharacterCodes
.
narrowNoBreakSpace
||
ch
===
CharacterCodes
.
mathematicalSpace
||
ch
===
CharacterCodes
.
ideographicSpace
||
ch
===
CharacterCodes
.
byteOrderMark
;
...
...
src/vs/editor/contrib/indentation/indentation.ts
浏览文件 @
e89ea5c9
...
...
@@ -589,13 +589,13 @@ export class AutoIndentOnPaste implements IEditorContribution {
private
shouldIgnoreLine
(
model
:
ITextModel
,
lineNumber
:
number
):
boolean
{
model
.
forceTokenization
(
lineNumber
);
let
nonWhite
spav
eColumn
=
model
.
getLineFirstNonWhitespaceColumn
(
lineNumber
);
if
(
nonWhite
spav
eColumn
===
0
)
{
let
nonWhite
Spac
eColumn
=
model
.
getLineFirstNonWhitespaceColumn
(
lineNumber
);
if
(
nonWhite
Spac
eColumn
===
0
)
{
return
true
;
}
let
tokens
=
model
.
getLineTokens
(
lineNumber
);
if
(
tokens
.
getCount
()
>
0
)
{
let
firstNonWhitespaceTokenIndex
=
tokens
.
findTokenIndexAtOffset
(
nonWhite
spav
eColumn
);
let
firstNonWhitespaceTokenIndex
=
tokens
.
findTokenIndexAtOffset
(
nonWhite
Spac
eColumn
);
if
(
firstNonWhitespaceTokenIndex
>=
0
&&
tokens
.
getStandardTokenType
(
firstNonWhitespaceTokenIndex
)
===
StandardTokenType
.
Comment
)
{
return
true
;
}
...
...
src/vs/editor/test/browser/controller/cursorMoveCommand.test.ts
浏览文件 @
e89ea5c9
...
...
@@ -132,7 +132,7 @@ suite('Cursor move command test', () => {
test
(
'
move to first non white space character of line from middle
'
,
()
=>
{
moveTo
(
thisCursor
,
1
,
8
);
moveToLineFirstNonWhite
spav
eCharacter
(
thisCursor
);
moveToLineFirstNonWhite
Spac
eCharacter
(
thisCursor
);
cursorEqual
(
thisCursor
,
1
,
6
);
});
...
...
@@ -140,7 +140,7 @@ suite('Cursor move command test', () => {
test
(
'
move to first non white space character of line from first non white space character
'
,
()
=>
{
moveTo
(
thisCursor
,
1
,
6
);
moveToLineFirstNonWhite
spav
eCharacter
(
thisCursor
);
moveToLineFirstNonWhite
Spac
eCharacter
(
thisCursor
);
cursorEqual
(
thisCursor
,
1
,
6
);
});
...
...
@@ -148,7 +148,7 @@ suite('Cursor move command test', () => {
test
(
'
move to first non white space character of line from first character
'
,
()
=>
{
moveTo
(
thisCursor
,
1
,
1
);
moveToLineFirstNonWhite
spav
eCharacter
(
thisCursor
);
moveToLineFirstNonWhite
Spac
eCharacter
(
thisCursor
);
cursorEqual
(
thisCursor
,
1
,
6
);
});
...
...
@@ -180,7 +180,7 @@ suite('Cursor move command test', () => {
test
(
'
move to last non white space character from middle
'
,
()
=>
{
moveTo
(
thisCursor
,
1
,
8
);
moveToLineLastNonWhite
spav
eCharacter
(
thisCursor
);
moveToLineLastNonWhite
Spac
eCharacter
(
thisCursor
);
cursorEqual
(
thisCursor
,
1
,
19
);
});
...
...
@@ -188,7 +188,7 @@ suite('Cursor move command test', () => {
test
(
'
move to last non white space character from last non white space character
'
,
()
=>
{
moveTo
(
thisCursor
,
1
,
19
);
moveToLineLastNonWhite
spav
eCharacter
(
thisCursor
);
moveToLineLastNonWhite
Spac
eCharacter
(
thisCursor
);
cursorEqual
(
thisCursor
,
1
,
19
);
});
...
...
@@ -196,7 +196,7 @@ suite('Cursor move command test', () => {
test
(
'
move to last non white space character from line end
'
,
()
=>
{
moveTo
(
thisCursor
,
1
,
21
);
moveToLineLastNonWhite
spav
eCharacter
(
thisCursor
);
moveToLineLastNonWhite
Spac
eCharacter
(
thisCursor
);
cursorEqual
(
thisCursor
,
1
,
19
);
});
...
...
@@ -415,7 +415,7 @@ function moveToLineStart(cursor: Cursor) {
move
(
cursor
,
{
to
:
CursorMove
.
RawDirection
.
WrappedLineStart
});
}
function
moveToLineFirstNonWhite
spav
eCharacter
(
cursor
:
Cursor
)
{
function
moveToLineFirstNonWhite
Spac
eCharacter
(
cursor
:
Cursor
)
{
move
(
cursor
,
{
to
:
CursorMove
.
RawDirection
.
WrappedLineFirstNonWhitespaceCharacter
});
}
...
...
@@ -427,7 +427,7 @@ function moveToLineEnd(cursor: Cursor) {
move
(
cursor
,
{
to
:
CursorMove
.
RawDirection
.
WrappedLineEnd
});
}
function
moveToLineLastNonWhite
spav
eCharacter
(
cursor
:
Cursor
)
{
function
moveToLineLastNonWhite
Spac
eCharacter
(
cursor
:
Cursor
)
{
move
(
cursor
,
{
to
:
CursorMove
.
RawDirection
.
WrappedLineLastNonWhitespaceCharacter
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录