Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0b27d444
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,发现更多精彩内容 >>
提交
0b27d444
编写于
2月 09, 2017
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Show search result count UI - Fix #6669
上级
d759bb70
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
9 deletion
+34
-9
src/vs/workbench/parts/search/browser/media/searchviewlet.css
...vs/workbench/parts/search/browser/media/searchviewlet.css
+6
-4
src/vs/workbench/parts/search/browser/searchViewlet.ts
src/vs/workbench/parts/search/browser/searchViewlet.ts
+28
-5
未找到文件。
src/vs/workbench/parts/search/browser/media/searchviewlet.css
浏览文件 @
0b27d444
...
...
@@ -72,7 +72,7 @@
.search-viewlet
.query-details
{
min-height
:
1em
;
position
:
relative
;
margin
:
0
0
6px
17px
;
margin
:
0
0
0
17px
;
}
.search-viewlet
.query-details
.more
{
...
...
@@ -107,7 +107,7 @@
}
.search-viewlet
.query-details.more
.file-types
:last-child
{
padding-bottom
:
4
px
;
padding-bottom
:
10
px
;
}
.search-viewlet
.query-details
.search-pattern-info
{
...
...
@@ -146,11 +146,13 @@
.search-viewlet
.message
{
padding-left
:
22px
;
padding-right
:
22px
;
padding-top
:
2
px
;
padding-top
:
0
px
;
}
.search-viewlet
.message
p
:first-child
{
margin-top
:
0
;
margin-top
:
0px
;
margin-bottom
:
0px
;
padding-bottom
:
4px
;
}
.search-viewlet
.filematch
{
...
...
src/vs/workbench/parts/search/browser/searchViewlet.ts
浏览文件 @
0b27d444
...
...
@@ -720,7 +720,10 @@ export class SearchViewlet extends Viewlet {
this
.
inputPatternIncludes
.
setWidth
(
this
.
size
.
width
-
28
/* container margin */
);
this
.
inputPatternGlobalExclusions
.
width
=
this
.
size
.
width
-
28
/* container margin */
-
24
/* actions */
;
let
searchResultContainerSize
=
this
.
size
.
height
-
dom
.
getTotalHeight
(
this
.
searchWidgetsContainer
.
getContainer
())
-
6
/** container margin top */
;
let
searchResultContainerSize
=
this
.
size
.
height
-
dom
.
getTotalHeight
(
this
.
messages
.
getHTMLElement
())
-
dom
.
getTotalHeight
(
this
.
searchWidgetsContainer
.
getContainer
());
this
.
results
.
style
({
height
:
searchResultContainerSize
+
'
px
'
});
this
.
tree
.
layout
(
searchResultContainerSize
);
...
...
@@ -1113,14 +1116,22 @@ export class SearchViewlet extends Viewlet {
}
// Search result tree update
let
c
ount
=
this
.
viewModel
.
searchResult
.
fileCount
();
if
(
visibleMatches
!==
c
ount
)
{
visibleMatches
=
c
ount
;
const
fileC
ount
=
this
.
viewModel
.
searchResult
.
fileCount
();
if
(
visibleMatches
!==
fileC
ount
)
{
visibleMatches
=
fileC
ount
;
this
.
tree
.
refresh
().
then
(()
=>
{
autoExpand
(
false
);
}).
done
(
null
,
errors
.
onUnexpectedError
);
// Update results text
const
msgWasHidden
=
this
.
messages
.
isHidden
();
const
div
=
this
.
clearMessage
();
$
(
div
).
p
({
text
:
this
.
buildResultCountMessage
(
this
.
viewModel
.
searchResult
.
count
(),
fileCount
)
});
if
(
msgWasHidden
)
{
this
.
reLayout
();
}
}
if
(
c
ount
>
0
)
{
if
(
fileC
ount
>
0
)
{
// since we have results now, enable some actions
if
(
!
this
.
actionRegistry
[
'
vs.tree.collapse
'
].
enabled
)
{
this
.
actionRegistry
[
'
vs.tree.collapse
'
].
enabled
=
true
;
...
...
@@ -1133,6 +1144,18 @@ export class SearchViewlet extends Viewlet {
this
.
viewModel
.
search
(
query
).
done
(
onComplete
,
onError
,
onProgress
);
}
private
buildResultCountMessage
(
resultCount
:
number
,
fileCount
:
number
):
string
{
if
(
resultCount
===
1
&&
fileCount
===
1
)
{
return
nls
.
localize
(
'
search.file.result
'
,
"
Found {0} result in {1} file
"
,
resultCount
,
fileCount
);
}
else
if
(
resultCount
===
1
)
{
return
nls
.
localize
(
'
search.files.result
'
,
"
Found {0} result in {1} files
"
,
resultCount
,
fileCount
);
}
else
if
(
fileCount
===
1
)
{
return
nls
.
localize
(
'
search.file.results
'
,
"
Found {0} results in {1} file
"
,
resultCount
,
fileCount
);
}
else
{
return
nls
.
localize
(
'
search.files.results
'
,
"
Found {0} results in {1} files
"
,
resultCount
,
fileCount
);
}
}
private
searchWithoutFolderMessage
(
div
:
Builder
):
void
{
$
(
div
).
p
({
text
:
nls
.
localize
(
'
searchWithoutFolder
'
,
"
You have not yet opened a folder. Only open files are currently searched -
"
)
})
.
asContainer
().
a
({
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录