Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
13cc8e1b
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,发现更多精彩内容 >>
提交
13cc8e1b
编写于
9月 12, 2018
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SearchView#onQueryChanged
💄
上级
96040c84
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
30 deletion
+16
-30
src/vs/workbench/parts/search/browser/searchActions.ts
src/vs/workbench/parts/search/browser/searchActions.ts
+1
-1
src/vs/workbench/parts/search/browser/searchView.ts
src/vs/workbench/parts/search/browser/searchView.ts
+11
-25
src/vs/workbench/parts/search/browser/searchWidget.ts
src/vs/workbench/parts/search/browser/searchWidget.ts
+4
-4
未找到文件。
src/vs/workbench/parts/search/browser/searchActions.ts
浏览文件 @
13cc8e1b
...
...
@@ -202,7 +202,7 @@ export class RefreshAction extends Action {
public
run
():
TPromise
<
void
>
{
const
searchView
=
getSearchView
(
this
.
viewletService
,
this
.
panelService
);
if
(
searchView
)
{
searchView
.
onQueryChanged
(
true
);
searchView
.
onQueryChanged
();
}
return
TPromise
.
as
(
null
);
}
...
...
src/vs/workbench/parts/search/browser/searchView.ts
浏览文件 @
13cc8e1b
...
...
@@ -8,7 +8,6 @@
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
*
as
aria
from
'
vs/base/browser/ui/aria/aria
'
;
import
{
FindInput
}
from
'
vs/base/browser/ui/findinput/findInput
'
;
import
{
MessageType
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
Delayer
}
from
'
vs/base/common/async
'
;
...
...
@@ -264,11 +263,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
this
.
inputPatternIncludes
.
setValue
(
patternIncludes
);
this
.
inputPatternIncludes
.
on
(
FindInput
.
OPTION_CHANGE
,
(
e
)
=>
{
this
.
onQueryChanged
(
false
);
});
this
.
inputPatternIncludes
.
onSubmit
(()
=>
this
.
onQueryChanged
(
true
,
true
));
this
.
inputPatternIncludes
.
onSubmit
(()
=>
this
.
onQueryChanged
(
true
));
this
.
inputPatternIncludes
.
onCancel
(()
=>
this
.
viewModel
.
cancelSearch
());
// Cancel search without focusing the search widget
this
.
trackInputBox
(
this
.
inputPatternIncludes
.
inputFocusTracker
,
this
.
inputPatternIncludesFocused
);
...
...
@@ -284,13 +279,8 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
this
.
inputPatternExcludes
.
setValue
(
patternExclusions
);
this
.
inputPatternExcludes
.
setUseExcludesAndIgnoreFiles
(
useExcludesAndIgnoreFiles
);
this
.
inputPatternExcludes
.
on
(
FindInput
.
OPTION_CHANGE
,
(
e
)
=>
{
this
.
onQueryChanged
(
false
);
});
this
.
inputPatternExcludes
.
onSubmit
(()
=>
this
.
onQueryChanged
(
true
,
true
));
this
.
inputPatternExcludes
.
onSubmit
(()
=>
this
.
onQueryChanged
(
true
,
true
));
this
.
inputPatternExcludes
.
onSubmit
(()
=>
this
.
onQueryChanged
(
true
));
this
.
inputPatternExcludes
.
onSubmit
(()
=>
this
.
onQueryChanged
(
true
));
this
.
inputPatternExcludes
.
onCancel
(()
=>
this
.
viewModel
.
cancelSearch
());
// Cancel search without focusing the search widget
this
.
trackInputBox
(
this
.
inputPatternExcludes
.
inputFocusTracker
,
this
.
inputPatternExclusionsFocused
);
...
...
@@ -356,9 +346,9 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
this
.
searchWidget
.
toggleReplace
(
true
);
}
this
.
_register
(
this
.
searchWidget
.
onSearchSubmit
((
refresh
)
=>
this
.
onQueryChanged
(
refresh
)));
this
.
_register
(
this
.
searchWidget
.
onSearchSubmit
((
)
=>
this
.
onQueryChanged
(
)));
this
.
_register
(
this
.
searchWidget
.
onSearchCancel
(()
=>
this
.
cancelSearch
()));
this
.
_register
(
this
.
searchWidget
.
searchInput
.
onDidOptionChange
((
viaKeyboard
)
=>
this
.
onQueryChanged
(
true
,
viaKeyboard
)));
this
.
_register
(
this
.
searchWidget
.
searchInput
.
onDidOptionChange
((
viaKeyboard
)
=>
this
.
onQueryChanged
(
viaKeyboard
)));
this
.
_register
(
this
.
searchWidget
.
onReplaceToggled
(()
=>
this
.
onReplaceToggled
()));
this
.
_register
(
this
.
searchWidget
.
onReplaceStateChange
((
state
)
=>
{
...
...
@@ -949,17 +939,17 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
public
toggleCaseSensitive
():
void
{
this
.
searchWidget
.
searchInput
.
setCaseSensitive
(
!
this
.
searchWidget
.
searchInput
.
getCaseSensitive
());
this
.
onQueryChanged
(
true
,
true
);
this
.
onQueryChanged
(
true
);
}
public
toggleWholeWords
():
void
{
this
.
searchWidget
.
searchInput
.
setWholeWords
(
!
this
.
searchWidget
.
searchInput
.
getWholeWords
());
this
.
onQueryChanged
(
true
,
true
);
this
.
onQueryChanged
(
true
);
}
public
toggleRegex
():
void
{
this
.
searchWidget
.
searchInput
.
setRegex
(
!
this
.
searchWidget
.
searchInput
.
getRegex
());
this
.
onQueryChanged
(
true
,
true
);
this
.
onQueryChanged
(
true
);
}
public
toggleQueryDetails
(
moveFocus
=
true
,
show
?:
boolean
,
skipLayout
?:
boolean
,
reverse
?:
boolean
):
void
{
...
...
@@ -1042,7 +1032,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
this
.
searchWidget
.
focus
(
false
);
}
public
onQueryChanged
(
rerunQuery
:
boolean
,
preserveFocus
?:
boolean
):
void
{
public
onQueryChanged
(
preserveFocus
?:
boolean
):
void
{
const
isRegex
=
this
.
searchWidget
.
searchInput
.
getRegex
();
const
isWholeWords
=
this
.
searchWidget
.
searchInput
.
getWholeWords
();
const
isCaseSensitive
=
this
.
searchWidget
.
searchInput
.
getCaseSensitive
();
...
...
@@ -1051,10 +1041,6 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
const
includePatternText
=
this
.
inputPatternIncludes
.
getValue
().
trim
();
const
useExcludesAndIgnoreFiles
=
this
.
inputPatternExcludes
.
useExcludesAndIgnoreFiles
();
if
(
!
rerunQuery
)
{
return
;
}
if
(
contentPattern
.
length
===
0
)
{
return
;
}
...
...
@@ -1241,7 +1227,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
const
searchAgainLink
=
dom
.
append
(
p
,
$
(
'
a.pointer.prominent
'
,
undefined
,
nls
.
localize
(
'
rerunSearch.message
'
,
"
Search again
"
)));
this
.
messageDisposables
.
push
(
dom
.
addDisposableListener
(
searchAgainLink
,
dom
.
EventType
.
CLICK
,
(
e
:
MouseEvent
)
=>
{
dom
.
EventHelper
.
stop
(
e
,
false
);
this
.
onQueryChanged
(
true
);
this
.
onQueryChanged
();
}));
}
else
if
(
hasIncludes
||
hasExcludes
)
{
const
searchAgainLink
=
dom
.
append
(
p
,
$
(
'
a.pointer.prominent
'
,
{
tabindex
:
0
},
nls
.
localize
(
'
rerunSearchInAll.message
'
,
"
Search again in all files
"
)));
...
...
@@ -1251,7 +1237,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
this
.
inputPatternExcludes
.
setValue
(
''
);
this
.
inputPatternIncludes
.
setValue
(
''
);
this
.
onQueryChanged
(
true
);
this
.
onQueryChanged
();
}));
}
else
{
const
openSettingsLink
=
dom
.
append
(
p
,
$
(
'
a.pointer.prominent
'
,
{
tabindex
:
0
},
nls
.
localize
(
'
openSettings.message
'
,
"
Open Settings
"
)));
...
...
src/vs/workbench/parts/search/browser/searchWidget.ts
浏览文件 @
13cc8e1b
...
...
@@ -99,8 +99,8 @@ export class SearchWidget extends Widget {
private
ignoreGlobalFindBufferOnNextFocus
=
false
;
private
previousGlobalFindBufferValue
:
string
;
private
_onSearchSubmit
=
this
.
_register
(
new
Emitter
<
boolean
>
());
public
readonly
onSearchSubmit
:
Event
<
boolean
>
=
this
.
_onSearchSubmit
.
event
;
private
_onSearchSubmit
=
this
.
_register
(
new
Emitter
<
void
>
());
public
readonly
onSearchSubmit
:
Event
<
void
>
=
this
.
_onSearchSubmit
.
event
;
private
_onSearchCancel
=
this
.
_register
(
new
Emitter
<
void
>
());
public
readonly
onSearchCancel
:
Event
<
void
>
=
this
.
_onSearchCancel
.
event
;
...
...
@@ -453,7 +453,7 @@ export class SearchWidget extends Widget {
}
}
private
submitSearch
(
refresh
:
boolean
=
true
):
void
{
private
submitSearch
():
void
{
const
value
=
this
.
searchInput
.
getValue
();
const
useGlobalFindBuffer
=
this
.
configurationService
.
getValue
<
ISearchConfigurationProperties
>
(
'
search
'
).
globalFindClipboard
;
if
(
value
)
{
...
...
@@ -461,7 +461,7 @@ export class SearchWidget extends Widget {
this
.
clipboardServce
.
writeFindText
(
value
);
}
this
.
_onSearchSubmit
.
fire
(
refresh
);
this
.
_onSearchSubmit
.
fire
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录