Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
79be3ae1
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,体验更适合开发者的 AI 搜索 >>
提交
79be3ae1
编写于
5月 23, 2017
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #20768. seedSearchStringFromSelection is now an option.
上级
87c24f2b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
66 addition
and
1 deletion
+66
-1
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+5
-0
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+42
-0
src/vs/editor/contrib/find/browser/findWidget.ts
src/vs/editor/contrib/find/browser/findWidget.ts
+2
-0
src/vs/editor/contrib/find/common/findController.ts
src/vs/editor/contrib/find/common/findController.ts
+1
-1
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+16
-0
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
79be3ae1
...
...
@@ -257,6 +257,11 @@ const editorConfiguration: IConfigurationNode = {
'
default
'
:
EDITOR_DEFAULTS
.
viewInfo
.
minimap
.
maxColumn
,
'
description
'
:
nls
.
localize
(
'
minimap.maxColumn
'
,
"
Limit the width of the minimap to render at most a certain number of columns
"
)
},
'
editor.find.seedSearchStringFromSelection
'
:
{
'
type
'
:
'
boolean
'
,
'
default
'
:
EDITOR_DEFAULTS
.
contribInfo
.
find
.
seedSearchStringFromSelection
,
'
description
'
:
nls
.
localize
(
'
find.seedSearchStringFromSelection
'
,
""
)
},
'
editor.wordWrap
'
:
{
'
type
'
:
'
string
'
,
'
enum
'
:
[
'
off
'
,
'
on
'
,
'
wordWrapColumn
'
,
'
bounded
'
],
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
79be3ae1
...
...
@@ -74,6 +74,13 @@ export interface IEditorScrollbarOptions {
horizontalSliderSize
?:
number
;
}
/**
* Configuration options for editor find widget
*/
export
interface
IEditorFindOptions
{
seedSearchStringFromSelection
?:
boolean
;
}
/**
* Configuration options for editor minimap
*/
...
...
@@ -186,6 +193,10 @@ export interface IEditorOptions {
* Control the behavior and rendering of the minimap.
*/
minimap
?:
IEditorMinimapOptions
;
/**
* Control the behavior of the find widget.
*/
find
?:
IEditorFindOptions
;
/**
* Display overflow widgets as `fixed`.
* Defaults to `false`.
...
...
@@ -672,6 +683,10 @@ export interface InternalEditorMinimapOptions {
readonly
maxColumn
:
number
;
}
export
interface
InternalEditorFindOptions
{
readonly
seedSearchStringFromSelection
:
boolean
;
}
export
interface
EditorWrappingInfo
{
readonly
inDiffEditor
:
boolean
;
readonly
isDominatedByLongLines
:
boolean
;
...
...
@@ -738,6 +753,7 @@ export interface EditorContribOptions {
readonly
folding
:
boolean
;
readonly
showFoldingControls
:
'
always
'
|
'
mouseover
'
;
readonly
matchBrackets
:
boolean
;
readonly
find
:
InternalEditorFindOptions
;
}
/**
...
...
@@ -1004,6 +1020,16 @@ export class InternalEditorOptions {
return
true
;
}
/**
* @internal
*/
private
static
_equalFindOptions
(
a
:
InternalEditorFindOptions
,
b
:
InternalEditorFindOptions
):
boolean
{
return
(
a
.
seedSearchStringFromSelection
===
b
.
seedSearchStringFromSelection
);
}
/**
* @internal
*/
...
...
@@ -1048,6 +1074,7 @@ export class InternalEditorOptions {
&&
a
.
folding
===
b
.
folding
&&
a
.
showFoldingControls
===
b
.
showFoldingControls
&&
a
.
matchBrackets
===
b
.
matchBrackets
&&
this
.
_equalFindOptions
(
a
.
find
,
b
.
find
)
);
}
...
...
@@ -1413,6 +1440,16 @@ export class EditorOptionsValidator {
};
}
private
static
_santizeFindOpts
(
opts
:
IEditorFindOptions
,
defaults
:
InternalEditorFindOptions
):
InternalEditorFindOptions
{
if
(
typeof
opts
!==
'
object
'
)
{
return
defaults
;
}
return
{
seedSearchStringFromSelection
:
_boolean
(
opts
.
seedSearchStringFromSelection
,
defaults
.
seedSearchStringFromSelection
)
};
}
private
static
_sanitizeViewInfo
(
opts
:
IEditorOptions
,
defaults
:
InternalEditorViewOptions
):
InternalEditorViewOptions
{
let
rulers
:
number
[]
=
[];
...
...
@@ -1524,6 +1561,7 @@ export class EditorOptionsValidator {
}
else
{
quickSuggestions
=
_boolean
(
opts
.
quickSuggestions
,
defaults
.
quickSuggestions
);
}
const
find
=
this
.
_santizeFindOpts
(
opts
.
find
,
defaults
.
find
);
return
{
selectionClipboard
:
_boolean
(
opts
.
selectionClipboard
,
defaults
.
selectionClipboard
),
hover
:
_boolean
(
opts
.
hover
,
defaults
.
hover
),
...
...
@@ -1547,6 +1585,7 @@ export class EditorOptionsValidator {
folding
:
!
performanceCritical
&&
_boolean
(
opts
.
folding
,
defaults
.
folding
),
showFoldingControls
:
_stringSet
<
'
always
'
|
'
mouseover
'
>
(
opts
.
showFoldingControls
,
defaults
.
showFoldingControls
,
[
'
always
'
,
'
mouseover
'
]),
matchBrackets
:
!
performanceCritical
&&
_boolean
(
opts
.
matchBrackets
,
defaults
.
matchBrackets
),
find
:
find
};
}
}
...
...
@@ -1955,5 +1994,8 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
folding
:
true
,
showFoldingControls
:
'
mouseover
'
,
matchBrackets
:
true
,
find
:
{
seedSearchStringFromSelection
:
true
}
},
};
src/vs/editor/contrib/find/browser/findWidget.ts
浏览文件 @
79be3ae1
...
...
@@ -246,8 +246,10 @@ export class FindWidget extends Widget implements IOverlayWidget {
}
if
(
e
.
isRevealed
)
{
if
(
this
.
_state
.
isRevealed
)
{
console
.
log
(
'
open find widget
'
);
this
.
_reveal
(
true
);
}
else
{
console
.
log
(
'
close find widget
'
);
this
.
_hide
(
true
);
}
}
...
...
src/vs/editor/contrib/find/common/findController.ts
浏览文件 @
79be3ae1
...
...
@@ -235,7 +235,7 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
};
// Consider editor selection and overwrite the state with it
if
(
opts
.
seedSearchStringFromSelection
)
{
if
(
opts
.
seedSearchStringFromSelection
&&
this
.
_editor
.
getConfiguration
().
contribInfo
.
find
.
seedSearchStringFromSelection
)
{
let
selectionSearchString
=
this
.
getSelectionSearchString
();
if
(
selectionSearchString
)
{
if
(
this
.
_state
.
isRegex
)
{
...
...
src/vs/monaco.d.ts
浏览文件 @
79be3ae1
...
...
@@ -2627,6 +2627,13 @@ declare module monaco.editor {
horizontalSliderSize
?:
number
;
}
/**
* Configuration options for editor find widget
*/
export
interface
IEditorFindOptions
{
seedSearchStringFromSelection
?:
boolean
;
}
/**
* Configuration options for editor minimap
*/
...
...
@@ -2734,6 +2741,10 @@ declare module monaco.editor {
* Control the behavior and rendering of the minimap.
*/
minimap
?:
IEditorMinimapOptions
;
/**
* Control the behavior of the find widget.
*/
find
?:
IEditorFindOptions
;
/**
* Display overflow widgets as `fixed`.
* Defaults to `false`.
...
...
@@ -3153,6 +3164,10 @@ declare module monaco.editor {
readonly
maxColumn
:
number
;
}
export
interface
InternalEditorFindOptions
{
readonly
seedSearchStringFromSelection
:
boolean
;
}
export
interface
EditorWrappingInfo
{
readonly
inDiffEditor
:
boolean
;
readonly
isDominatedByLongLines
:
boolean
;
...
...
@@ -3223,6 +3238,7 @@ declare module monaco.editor {
readonly
folding
:
boolean
;
readonly
showFoldingControls
:
'
always
'
|
'
mouseover
'
;
readonly
matchBrackets
:
boolean
;
readonly
find
:
InternalEditorFindOptions
;
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录