Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d01bc20b
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,发现更多精彩内容 >>
提交
d01bc20b
编写于
10月 04, 2016
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #13196
上级
93399263
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
12 deletion
+27
-12
src/vs/workbench/parts/search/browser/search.contribution.ts
src/vs/workbench/parts/search/browser/search.contribution.ts
+1
-0
src/vs/workbench/parts/search/browser/searchActions.ts
src/vs/workbench/parts/search/browser/searchActions.ts
+14
-0
src/vs/workbench/parts/search/browser/searchWidget.ts
src/vs/workbench/parts/search/browser/searchWidget.ts
+10
-12
src/vs/workbench/parts/search/common/constants.ts
src/vs/workbench/parts/search/common/constants.ts
+2
-0
未找到文件。
src/vs/workbench/parts/search/browser/search.contribution.ts
浏览文件 @
d01bc20b
...
...
@@ -181,6 +181,7 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(searchActions.FocusPre
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
searchActions
.
ToggleCaseSensitiveAction
,
Constants
.
ToggleCaseSensitiveActionId
,
''
,
ToggleCaseSensitiveKeybinding
,
ContextKeyExpr
.
and
(
Constants
.
SearchViewletVisibleKey
,
Constants
.
SearchInputBoxFocussedKey
)),
''
);
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
searchActions
.
ToggleWholeWordAction
,
Constants
.
ToggleWholeWordActionId
,
''
,
ToggleWholeWordKeybinding
,
ContextKeyExpr
.
and
(
Constants
.
SearchViewletVisibleKey
,
Constants
.
SearchInputBoxFocussedKey
)),
''
);
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
searchActions
.
ToggleRegexAction
,
Constants
.
ToggleRegexActionId
,
''
,
ToggleRegexKeybinding
,
ContextKeyExpr
.
and
(
Constants
.
SearchViewletVisibleKey
,
Constants
.
SearchInputBoxFocussedKey
)),
''
);
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
searchActions
.
CloseReplaceAction
,
Constants
.
CloseReplaceWidgetActionId
,
''
,
{
primary
:
KeyCode
.
Escape
},
ContextKeyExpr
.
and
(
Constants
.
SearchViewletVisibleKey
,
Constants
.
ReplaceInputBoxFocussedKey
)),
''
);
// Configuration
const
configurationRegistry
=
<
IConfigurationRegistry
>
Registry
.
as
(
ConfigurationExtensions
.
Configuration
);
...
...
src/vs/workbench/parts/search/browser/searchActions.ts
浏览文件 @
d01bc20b
...
...
@@ -170,6 +170,20 @@ export class ReplaceInFilesAction extends Action {
}
}
export
class
CloseReplaceAction
extends
Action
{
constructor
(
id
:
string
,
label
:
string
,
@
IViewletService
private
viewletService
:
IViewletService
)
{
super
(
id
,
label
);
}
public
run
():
TPromise
<
any
>
{
let
searchAndReplaceWidget
=
(
<
SearchViewlet
>
this
.
viewletService
.
getActiveViewlet
()).
searchAndReplaceWidget
;
searchAndReplaceWidget
.
toggleReplace
(
false
);
searchAndReplaceWidget
.
focus
();
return
TPromise
.
as
(
null
);
}
}
export
class
FindInFolderAction
extends
Action
{
private
resource
:
URI
;
...
...
src/vs/workbench/parts/search/browser/searchWidget.ts
浏览文件 @
d01bc20b
...
...
@@ -76,6 +76,7 @@ export class SearchWidget extends Widget {
public
domNode
:
HTMLElement
;
public
searchInput
:
FindInput
;
private
searchInputBoxFocussed
:
IContextKey
<
boolean
>
;
private
replaceInputBoxFocussed
:
IContextKey
<
boolean
>
;
private
replaceInput
:
InputBox
;
public
searchInputFocusTracker
:
dom
.
IFocusTracker
;
...
...
@@ -113,6 +114,7 @@ export class SearchWidget extends Widget {
this
.
searchHistory
=
new
HistoryNavigator
<
string
>
();
this
.
replaceActive
=
Constants
.
ReplaceActiveKey
.
bindTo
(
this
.
keyBindingService
);
this
.
searchInputBoxFocussed
=
Constants
.
SearchInputBoxFocussedKey
.
bindTo
(
this
.
keyBindingService
);
this
.
replaceInputBoxFocussed
=
Constants
.
ReplaceInputBoxFocussedKey
.
bindTo
(
this
.
keyBindingService
);
this
.
render
(
container
,
options
);
}
...
...
@@ -218,7 +220,7 @@ export class SearchWidget extends Widget {
this
.
searchHistory
.
add
(
this
.
searchInput
.
getValue
());
}));
this
.
searchInputFocusTracker
=
dom
.
trackFocus
(
this
.
searchInput
.
inputBox
.
inputElement
);
this
.
searchInputFocusTracker
=
this
.
_register
(
dom
.
trackFocus
(
this
.
searchInput
.
inputBox
.
inputElement
)
);
this
.
_register
(
this
.
searchInputFocusTracker
.
addFocusListener
(()
=>
{
this
.
searchInputBoxFocussed
.
set
(
true
);
}));
...
...
@@ -244,7 +246,13 @@ export class SearchWidget extends Widget {
this
.
replaceActionBar
=
this
.
_register
(
new
ActionBar
(
this
.
replaceContainer
));
this
.
replaceActionBar
.
push
([
this
.
replaceAllAction
],
{
icon
:
true
,
label
:
false
});
this
.
replaceInputFocusTracker
=
dom
.
trackFocus
(
this
.
replaceInput
.
inputElement
);
this
.
replaceInputFocusTracker
=
this
.
_register
(
dom
.
trackFocus
(
this
.
replaceInput
.
inputElement
));
this
.
_register
(
this
.
replaceInputFocusTracker
.
addFocusListener
(()
=>
{
this
.
replaceInputBoxFocussed
.
set
(
true
);
}));
this
.
_register
(
this
.
replaceInputFocusTracker
.
addBlurListener
(()
=>
{
this
.
replaceInputBoxFocussed
.
set
(
false
);
}));
}
triggerReplaceAll
():
TPromise
<
any
>
{
...
...
@@ -321,10 +329,6 @@ export class SearchWidget extends Widget {
case
KeyCode
.
Enter
:
this
.
submitSearch
();
return
;
case
KeyCode
.
Escape
:
this
.
onToggleReplaceButton
();
this
.
searchInput
.
focus
();
return
;
default
:
return
;
}
...
...
@@ -340,12 +344,6 @@ export class SearchWidget extends Widget {
this
.
setReplaceAllActionState
(
false
);
this
.
replaceAllAction
.
searchWidget
=
null
;
this
.
replaceActionBar
=
null
;
if
(
this
.
searchInputFocusTracker
)
{
this
.
searchInputFocusTracker
.
dispose
();
}
if
(
this
.
replaceInputFocusTracker
)
{
this
.
replaceInputFocusTracker
.
dispose
();
}
super
.
dispose
();
}
}
...
...
src/vs/workbench/parts/search/common/constants.ts
浏览文件 @
d01bc20b
...
...
@@ -10,9 +10,11 @@ export const VIEWLET_ID = 'workbench.view.search';
export
const
ToggleCaseSensitiveActionId
=
'
toggleSearchCaseSensitive
'
;
export
const
ToggleWholeWordActionId
=
'
toggleSearchWholeWord
'
;
export
const
ToggleRegexActionId
=
'
toggleSearchRegex
'
;
export
const
CloseReplaceWidgetActionId
=
'
closeReplaceInFilesWidget
'
;
export
const
SearchViewletVisibleKey
=
new
RawContextKey
<
boolean
>
(
'
searchViewletVisible
'
,
true
);
export
const
InputBoxFocussedKey
=
new
RawContextKey
<
boolean
>
(
'
inputBoxFocus
'
,
false
);
export
const
SearchInputBoxFocussedKey
=
new
RawContextKey
<
boolean
>
(
'
searchInputBoxFocus
'
,
false
);
export
const
ReplaceInputBoxFocussedKey
=
new
RawContextKey
<
boolean
>
(
'
replaceInputBoxFocus
'
,
false
);
export
const
ReplaceActiveKey
=
new
RawContextKey
<
boolean
>
(
'
replaceActive
'
,
false
);
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录