Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
48cd52e4
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,发现更多精彩内容 >>
提交
48cd52e4
编写于
6月 27, 2016
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve Keyboard navigation while removing entries from results
上级
e2287690
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
16 deletion
+34
-16
src/vs/workbench/parts/search/browser/searchActions.ts
src/vs/workbench/parts/search/browser/searchActions.ts
+27
-9
src/vs/workbench/parts/search/browser/searchResultsView.ts
src/vs/workbench/parts/search/browser/searchResultsView.ts
+4
-0
src/vs/workbench/parts/search/common/searchModel.ts
src/vs/workbench/parts/search/common/searchModel.ts
+3
-7
未找到文件。
src/vs/workbench/parts/search/browser/searchActions.ts
浏览文件 @
48cd52e4
...
@@ -98,24 +98,42 @@ export class RemoveAction extends Action {
...
@@ -98,24 +98,42 @@ export class RemoveAction extends Action {
}
}
public
run
(
retainFocus
:
boolean
=
true
):
TPromise
<
any
>
{
public
run
(
retainFocus
:
boolean
=
true
):
TPromise
<
any
>
{
if
(
this
.
viewer
.
getFocus
()
===
this
.
viewer
.
getNavigator
().
last
())
{
this
.
viewer
.
focusPrevious
();
if
(
this
.
element
===
this
.
viewer
.
getFocus
())
{
}
else
{
let
nextFocusElement
=
this
.
getNextFocusElement
();
this
.
viewer
.
focusNext
();
if
(
nextFocusElement
)
{
this
.
viewer
.
setFocus
(
nextFocusElement
);
}
else
{
this
.
viewer
.
focusPrevious
();
}
}
}
let
parent
:
any
;
let
elementToRefresh
:
any
;
if
(
this
.
element
instanceof
FileMatch
)
{
if
(
this
.
element
instanceof
FileMatch
)
{
paren
t
=
<
SearchResult
>
this
.
element
.
parent
();
let
parent
:
SearchResul
t
=
<
SearchResult
>
this
.
element
.
parent
();
parent
.
remove
(
<
FileMatch
>
this
.
element
);
parent
.
remove
(
<
FileMatch
>
this
.
element
);
elementToRefresh
=
parent
;
}
else
{
}
else
{
parent
=
<
FileMatch
>
this
.
element
.
parent
();
let
parent
:
FileMatch
=
<
FileMatch
>
this
.
element
.
parent
();
parent
.
remove
(
<
Match
>
this
.
element
);
parent
.
remove
(
<
Match
>
this
.
element
);
elementToRefresh
=
parent
.
count
()
===
0
?
parent
.
parent
()
:
parent
;
}
}
if
(
retainFocus
)
{
if
(
retainFocus
&&
this
.
viewer
.
getFocus
())
{
this
.
viewer
.
DOMFocus
();
this
.
viewer
.
DOMFocus
();
}
}
return
this
.
viewer
.
refresh
(
parent
);
return
this
.
viewer
.
refresh
(
elementToRefresh
);
}
private
getNextFocusElement
():
FileMatchOrMatch
{
let
navigator
=
this
.
viewer
.
getNavigator
();
while
(
navigator
.
current
()
!==
this
.
element
&&
!!
navigator
.
next
())
{};
if
(
this
.
element
instanceof
FileMatch
)
{
while
(
!!
navigator
.
next
()
&&
!
(
navigator
.
current
()
instanceof
FileMatch
))
{};
return
navigator
.
current
();
}
else
{
return
navigator
.
next
();
}
}
}
}
}
...
...
src/vs/workbench/parts/search/browser/searchResultsView.ts
浏览文件 @
48cd52e4
...
@@ -212,6 +212,10 @@ export class SearchAccessibilityProvider implements IAccessibilityProvider {
...
@@ -212,6 +212,10 @@ export class SearchAccessibilityProvider implements IAccessibilityProvider {
return
nls
.
localize
(
'
fileMatchAriaLabel
'
,
"
{0} matches in file {1} of folder {2}, Search result
"
,
element
.
count
(),
element
.
name
(),
paths
.
dirname
(
path
));
return
nls
.
localize
(
'
fileMatchAriaLabel
'
,
"
{0} matches in file {1} of folder {2}, Search result
"
,
element
.
count
(),
element
.
name
(),
paths
.
dirname
(
path
));
}
}
if
(
element
instanceof
EmptyMatch
)
{
return
nls
.
localize
(
'
emptyMatchAriaLabel
'
,
"
No matches
"
);
}
if
(
element
instanceof
Match
)
{
if
(
element
instanceof
Match
)
{
let
input
=
<
SearchResult
>
tree
.
getInput
();
let
input
=
<
SearchResult
>
tree
.
getInput
();
if
(
input
.
isReplaceActive
())
{
if
(
input
.
isReplaceActive
())
{
...
...
src/vs/workbench/parts/search/common/searchModel.ts
浏览文件 @
48cd52e4
...
@@ -99,6 +99,9 @@ export class FileMatch extends EventEmitter implements lifecycle.IDisposable {
...
@@ -99,6 +99,9 @@ export class FileMatch extends EventEmitter implements lifecycle.IDisposable {
public
remove
(
match
:
Match
):
void
{
public
remove
(
match
:
Match
):
void
{
delete
this
.
_matches
[
match
.
id
()];
delete
this
.
_matches
[
match
.
id
()];
if
(
this
.
count
()
===
0
)
{
this
.
add
(
new
EmptyMatch
(
this
));
}
}
}
public
matches
():
Match
[]
{
public
matches
():
Match
[]
{
...
@@ -204,13 +207,6 @@ export class LiveFileMatch extends FileMatch implements lifecycle.IDisposable {
...
@@ -204,13 +207,6 @@ export class LiveFileMatch extends FileMatch implements lifecycle.IDisposable {
return
!
this
.
_model
||
(
<
ITextModel
>
this
.
_model
).
isDisposed
();
return
!
this
.
_model
||
(
<
ITextModel
>
this
.
_model
).
isDisposed
();
}
}
public
remove
(
match
:
Match
):
void
{
super
.
remove
(
match
);
if
(
this
.
count
()
===
0
)
{
this
.
add
(
new
EmptyMatch
(
this
));
}
}
}
}
export
class
SearchResult
extends
EventEmitter
{
export
class
SearchResult
extends
EventEmitter
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录