Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4172bc6a
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,发现更多精彩内容 >>
提交
4172bc6a
编写于
2月 06, 2019
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #67936
上级
159617a3
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
30 addition
and
25 deletion
+30
-25
src/vs/base/browser/ui/tree/abstractTree.ts
src/vs/base/browser/ui/tree/abstractTree.ts
+30
-25
未找到文件。
src/vs/base/browser/ui/tree/abstractTree.ts
浏览文件 @
4172bc6a
...
...
@@ -531,7 +531,10 @@ class TypeFilterController<T, TFilterData> implements IDisposable {
this
.
_pattern
=
pattern
;
this
.
filter
.
pattern
=
pattern
;
this
.
tree
.
refilter
();
this
.
tree
.
focusNext
(
0
,
true
);
if
(
pattern
)
{
this
.
tree
.
focusNext
(
0
,
true
,
undefined
,
node
=>
!
FuzzyScore
.
isDefault
(
node
.
filterData
as
any
as
FuzzyScore
));
}
const
focus
=
this
.
tree
.
getFocus
();
...
...
@@ -648,6 +651,18 @@ class TypeFilterController<T, TFilterData> implements IDisposable {
this
.
labelDomNode
.
textContent
=
this
.
pattern
.
length
>
16
?
'
…
'
+
this
.
pattern
.
substr
(
this
.
pattern
.
length
-
16
)
:
this
.
pattern
;
}
shouldAllowFocus
(
node
:
ITreeNode
<
T
,
TFilterData
>
):
boolean
{
if
(
!
this
.
enabled
||
!
this
.
pattern
||
this
.
filterOnType
)
{
return
true
;
}
if
(
this
.
filter
.
totalCount
>
0
&&
this
.
filter
.
matchCount
<=
1
)
{
return
true
;
}
return
!
FuzzyScore
.
isDefault
(
node
.
filterData
as
any
as
FuzzyScore
);
}
dispose
()
{
this
.
disable
();
this
.
disposables
=
dispose
(
this
.
disposables
);
...
...
@@ -898,12 +913,12 @@ export abstract class AbstractTree<T, TFilterData, TRef> implements IDisposable
private
view
:
TreeNodeList
<
T
,
TFilterData
,
TRef
>
;
private
renderers
:
TreeRenderer
<
T
,
TFilterData
,
any
>
[];
private
focusNavigationFilter
:
((
node
:
ITreeNode
<
T
,
TFilterData
>
)
=>
boolean
)
|
undefined
;
protected
model
:
ITreeModel
<
T
,
TFilterData
,
TRef
>
;
private
focus
:
Trait
<
T
>
;
private
selection
:
Trait
<
T
>
;
private
eventBufferer
=
new
EventBufferer
();
private
typeFilterController
?:
TypeFilterController
<
T
,
TFilterData
>
;
private
focusNavigationFilter
:
((
node
:
ITreeNode
<
T
,
TFilterData
>
)
=>
boolean
)
|
undefined
;
protected
disposables
:
IDisposable
[]
=
[];
get
onDidScroll
():
Event
<
void
>
{
return
this
.
view
.
onDidScroll
;
}
...
...
@@ -981,17 +996,7 @@ export abstract class AbstractTree<T, TFilterData, TRef> implements IDisposable
if
(
_options
.
keyboardNavigationLabelProvider
)
{
this
.
typeFilterController
=
new
TypeFilterController
(
this
,
this
.
model
,
this
.
view
,
filter
!
,
_options
.
keyboardNavigationLabelProvider
);
this
.
focusNavigationFilter
=
node
=>
{
if
(
!
this
.
typeFilterController
!
.
enabled
||
!
this
.
typeFilterController
!
.
pattern
||
this
.
typeFilterController
!
.
filterOnType
)
{
return
true
;
}
if
(
filter
!
.
totalCount
>
0
&&
filter
!
.
matchCount
<=
1
)
{
return
true
;
}
return
!
FuzzyScore
.
isDefault
(
node
.
filterData
as
any
as
FuzzyScore
);
};
this
.
focusNavigationFilter
=
node
=>
this
.
typeFilterController
!
.
shouldAllowFocus
(
node
);
this
.
disposables
.
push
(
this
.
typeFilterController
!
);
}
}
...
...
@@ -1147,28 +1152,28 @@ export abstract class AbstractTree<T, TFilterData, TRef> implements IDisposable
this
.
view
.
setFocus
(
indexes
,
browserEvent
,
true
);
}
focusNext
(
n
=
1
,
loop
=
false
,
browserEvent
?:
UIEvent
):
void
{
this
.
view
.
focusNext
(
n
,
loop
,
browserEvent
,
this
.
focusNavigationF
ilter
);
focusNext
(
n
=
1
,
loop
=
false
,
browserEvent
?:
UIEvent
,
filter
=
this
.
focusNavigationFilter
):
void
{
this
.
view
.
focusNext
(
n
,
loop
,
browserEvent
,
f
ilter
);
}
focusPrevious
(
n
=
1
,
loop
=
false
,
browserEvent
?:
UIEvent
):
void
{
this
.
view
.
focusPrevious
(
n
,
loop
,
browserEvent
,
this
.
focusNavigationF
ilter
);
focusPrevious
(
n
=
1
,
loop
=
false
,
browserEvent
?:
UIEvent
,
filter
=
this
.
focusNavigationFilter
):
void
{
this
.
view
.
focusPrevious
(
n
,
loop
,
browserEvent
,
f
ilter
);
}
focusNextPage
(
browserEvent
?:
UIEvent
):
void
{
this
.
view
.
focusNextPage
(
browserEvent
,
this
.
focusNavigationF
ilter
);
focusNextPage
(
browserEvent
?:
UIEvent
,
filter
=
this
.
focusNavigationFilter
):
void
{
this
.
view
.
focusNextPage
(
browserEvent
,
f
ilter
);
}
focusPreviousPage
(
browserEvent
?:
UIEvent
):
void
{
this
.
view
.
focusPreviousPage
(
browserEvent
,
this
.
focusNavigationF
ilter
);
focusPreviousPage
(
browserEvent
?:
UIEvent
,
filter
=
this
.
focusNavigationFilter
):
void
{
this
.
view
.
focusPreviousPage
(
browserEvent
,
f
ilter
);
}
focusLast
(
browserEvent
?:
UIEvent
):
void
{
this
.
view
.
focusLast
(
browserEvent
,
this
.
focusNavigationF
ilter
);
focusLast
(
browserEvent
?:
UIEvent
,
filter
=
this
.
focusNavigationFilter
):
void
{
this
.
view
.
focusLast
(
browserEvent
,
f
ilter
);
}
focusFirst
(
browserEvent
?:
UIEvent
):
void
{
this
.
view
.
focusFirst
(
browserEvent
,
this
.
focusNavigationF
ilter
);
focusFirst
(
browserEvent
?:
UIEvent
,
filter
=
this
.
focusNavigationFilter
):
void
{
this
.
view
.
focusFirst
(
browserEvent
,
f
ilter
);
}
getFocus
():
T
[]
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录