Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
a0147017
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,发现更多精彩内容 >>
提交
a0147017
编写于
2月 22, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add `editor.wordSeparators` option
上级
940c8d43
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
1 deletion
+20
-1
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+8
-0
src/vs/editor/common/config/defaultConfig.ts
src/vs/editor/common/config/defaultConfig.ts
+3
-0
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+7
-0
src/vs/editor/common/modes/nullMode.ts
src/vs/editor/common/modes/nullMode.ts
+2
-1
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
a0147017
...
...
@@ -66,6 +66,7 @@ function cloneInternalEditorOptions(opts: editorCommon.IInternalEditorOptions):
return
{
experimentalScreenReader
:
opts
.
experimentalScreenReader
,
rulers
:
opts
.
rulers
.
slice
(
0
),
wordSeparators
:
opts
.
wordSeparators
,
ariaLabel
:
opts
.
ariaLabel
,
lineNumbers
:
opts
.
lineNumbers
,
selectOnLineNumbers
:
opts
.
selectOnLineNumbers
,
...
...
@@ -279,6 +280,7 @@ class InternalEditorOptionsHelper {
cursorBlinking
:
opts
.
cursorBlinking
,
experimentalScreenReader
:
toBoolean
(
opts
.
experimentalScreenReader
),
rulers
:
toSortedIntegerArray
(
opts
.
rulers
),
wordSeparators
:
String
(
opts
.
wordSeparators
),
ariaLabel
:
String
(
opts
.
ariaLabel
),
cursorStyle
:
opts
.
cursorStyle
,
fontLigatures
:
toBoolean
(
opts
.
fontLigatures
),
...
...
@@ -360,6 +362,7 @@ class InternalEditorOptionsHelper {
return
{
experimentalScreenReader
:
(
prevOpts
.
experimentalScreenReader
!==
newOpts
.
experimentalScreenReader
),
rulers
:
(
!
this
.
_numberArraysEqual
(
prevOpts
.
rulers
,
newOpts
.
rulers
)),
wordSeparators
:
(
prevOpts
.
wordSeparators
!==
newOpts
.
wordSeparators
),
ariaLabel
:
(
prevOpts
.
ariaLabel
!==
newOpts
.
ariaLabel
),
lineNumbers
:
(
prevOpts
.
lineNumbers
!==
newOpts
.
lineNumbers
),
...
...
@@ -876,6 +879,11 @@ configurationRegistry.registerConfiguration({
'
default
'
:
DefaultConfig
.
editor
.
rulers
,
'
description
'
:
nls
.
localize
(
'
rulers
'
,
"
Columns at which to show vertical rulers
"
)
},
'
editor.wordSeparators
'
:
{
'
type
'
:
'
string
'
,
'
default
'
:
DefaultConfig
.
editor
.
wordSeparators
,
'
description
'
:
nls
.
localize
(
'
wordSeparators
'
,
"
Characters that will be used as word separators when doing word related navigations or operations
"
)
},
'
editor.tabSize
'
:
{
'
oneOf
'
:
[
{
...
...
src/vs/editor/common/config/defaultConfig.ts
浏览文件 @
a0147017
...
...
@@ -11,6 +11,8 @@ export interface IConfiguration {
editor
:
IEditorOptions
;
}
export
const
USUAL_WORD_SEPARATORS
=
'
`~!@#$%^&*()-=+[{]}
\\
|;:
\'
",.<>/?
'
;
class
ConfigClass
implements
IConfiguration
{
public
editor
:
IEditorOptions
;
...
...
@@ -19,6 +21,7 @@ class ConfigClass implements IConfiguration {
this
.
editor
=
{
experimentalScreenReader
:
false
,
rulers
:
[],
wordSeparators
:
USUAL_WORD_SEPARATORS
,
ariaLabel
:
nls
.
localize
(
'
editorViewAccessibleLabel
'
,
"
Editor content
"
),
lineNumbers
:
true
,
selectOnLineNumbers
:
true
,
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
a0147017
...
...
@@ -279,6 +279,11 @@ export interface IEditorOptions {
* Defaults to empty array.
*/
rulers
?:
number
[];
/**
* A string containing the word separators used when doing word navigation.
* Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?
*/
wordSeparators
?:
string
;
/**
* Control the rendering of line numbers.
* If it is a function, it will be invoked when rendering a line number and the return value will be rendered.
...
...
@@ -591,6 +596,7 @@ export interface IEditorWrappingInfo {
export
interface
IInternalEditorOptions
{
experimentalScreenReader
:
boolean
;
rulers
:
number
[];
wordSeparators
:
string
;
ariaLabel
:
string
;
// ---- Options that are transparent - get no massaging
...
...
@@ -679,6 +685,7 @@ export interface IInternalEditorOptions {
export
interface
IConfigurationChangedEvent
{
experimentalScreenReader
:
boolean
;
rulers
:
boolean
;
wordSeparators
:
boolean
;
ariaLabel
:
boolean
;
// ---- Options that are transparent - get no massaging
...
...
src/vs/editor/common/modes/nullMode.ts
浏览文件 @
a0147017
...
...
@@ -5,6 +5,7 @@
'
use strict
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
{
USUAL_WORD_SEPARATORS
}
from
'
vs/editor/common/config/defaultConfig
'
;
export
class
NullState
implements
modes
.
IState
{
...
...
@@ -63,7 +64,7 @@ export class NullMode implements modes.IMode {
* /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g
*/
public
static
createWordRegExp
(
allowInWords
:
string
=
''
):
RegExp
{
var
usualSeparators
=
'
`~!@#$%^&*()-=+[{]}
\\
|;:
\'
",.<>/?
'
;
var
usualSeparators
=
USUAL_WORD_SEPARATORS
;
var
source
=
'
(-?
\\
d*
\\
.
\\
d
\\
w*)|([^
'
;
for
(
var
i
=
0
;
i
<
usualSeparators
.
length
;
i
++
)
{
if
(
allowInWords
.
indexOf
(
usualSeparators
[
i
])
>=
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录