Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
d28a7fd5
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,发现更多精彩内容 >>
未验证
提交
d28a7fd5
编写于
6月 28, 2019
作者:
D
Daniel Imms
提交者:
GitHub
6月 28, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #73692 from Urange/master
Potential fix for issue #73396
上级
6b1349c1
1343c94b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
8 deletion
+24
-8
src/vs/editor/contrib/find/simpleFindWidget.css
src/vs/editor/contrib/find/simpleFindWidget.css
+1
-1
src/vs/editor/contrib/find/simpleFindWidget.ts
src/vs/editor/contrib/find/simpleFindWidget.ts
+20
-6
src/vs/workbench/contrib/terminal/browser/terminalFindWidget.ts
.../workbench/contrib/terminal/browser/terminalFindWidget.ts
+2
-1
src/vs/workbench/contrib/webview/browser/webviewFindWidget.ts
...vs/workbench/contrib/webview/browser/webviewFindWidget.ts
+1
-0
未找到文件。
src/vs/editor/contrib/find/simpleFindWidget.css
浏览文件 @
d28a7fd5
...
...
@@ -78,7 +78,7 @@
background-image
:
url('images/close-dark.svg')
;
}
monaco-workbench
.simple-find-part
.button.disabled
{
.
monaco-workbench
.simple-find-part
.button.disabled
{
opacity
:
0.3
;
cursor
:
default
;
}
\ No newline at end of file
src/vs/editor/contrib/find/simpleFindWidget.ts
浏览文件 @
d28a7fd5
...
...
@@ -33,6 +33,9 @@ export abstract class SimpleFindWidget extends Widget {
private
readonly
_focusTracker
:
dom
.
IFocusTracker
;
private
readonly
_findInputFocusTracker
:
dom
.
IFocusTracker
;
private
readonly
_updateHistoryDelayer
:
Delayer
<
void
>
;
private
prevBtn
:
SimpleButton
;
private
nextBtn
:
SimpleButton
;
private
foundMatch
:
boolean
;
constructor
(
@
IContextViewService
private
readonly
_contextViewService
:
IContextViewService
,
...
...
@@ -54,6 +57,8 @@ export abstract class SimpleFindWidget extends Widget {
new
RegExp
(
value
);
return
null
;
}
catch
(
e
)
{
this
.
foundMatch
=
false
;
this
.
updateButtons
();
return
{
content
:
e
.
message
};
}
}
...
...
@@ -63,7 +68,8 @@ export abstract class SimpleFindWidget extends Widget {
this
.
_updateHistoryDelayer
=
new
Delayer
<
void
>
(
500
);
this
.
oninput
(
this
.
_findInput
.
domNode
,
(
e
)
=>
{
this
.
onInputChanged
();
this
.
foundMatch
=
this
.
onInputChanged
();
this
.
updateButtons
();
this
.
_delayedUpdateHistory
();
});
...
...
@@ -99,7 +105,7 @@ export abstract class SimpleFindWidget extends Widget {
}
}));
const
prevBtn
=
this
.
_register
(
new
SimpleButton
({
this
.
prevBtn
=
this
.
_register
(
new
SimpleButton
({
label
:
NLS_PREVIOUS_MATCH_BTN_LABEL
,
className
:
'
previous
'
,
onTrigger
:
()
=>
{
...
...
@@ -107,7 +113,7 @@ export abstract class SimpleFindWidget extends Widget {
}
}));
const
nextBtn
=
this
.
_register
(
new
SimpleButton
({
this
.
nextBtn
=
this
.
_register
(
new
SimpleButton
({
label
:
NLS_NEXT_MATCH_BTN_LABEL
,
className
:
'
next
'
,
onTrigger
:
()
=>
{
...
...
@@ -126,8 +132,8 @@ export abstract class SimpleFindWidget extends Widget {
this
.
_innerDomNode
=
document
.
createElement
(
'
div
'
);
this
.
_innerDomNode
.
classList
.
add
(
'
simple-find-part
'
);
this
.
_innerDomNode
.
appendChild
(
this
.
_findInput
.
domNode
);
this
.
_innerDomNode
.
appendChild
(
prevBtn
.
domNode
);
this
.
_innerDomNode
.
appendChild
(
nextBtn
.
domNode
);
this
.
_innerDomNode
.
appendChild
(
this
.
prevBtn
.
domNode
);
this
.
_innerDomNode
.
appendChild
(
this
.
nextBtn
.
domNode
);
this
.
_innerDomNode
.
appendChild
(
closeBtn
.
domNode
);
// _domNode wraps _innerDomNode, ensuring that
...
...
@@ -156,7 +162,7 @@ export abstract class SimpleFindWidget extends Widget {
}));
}
protected
abstract
onInputChanged
():
void
;
protected
abstract
onInputChanged
():
boolean
;
protected
abstract
find
(
previous
:
boolean
):
void
;
protected
abstract
onFocusTrackerFocus
():
void
;
protected
abstract
onFocusTrackerBlur
():
void
;
...
...
@@ -213,6 +219,7 @@ export abstract class SimpleFindWidget extends Widget {
}
this
.
_isVisible
=
true
;
this
.
updateButtons
();
setTimeout
(()
=>
{
dom
.
addClass
(
this
.
_innerDomNode
,
'
visible
'
);
...
...
@@ -243,6 +250,7 @@ export abstract class SimpleFindWidget extends Widget {
// Need to delay toggling visibility until after Transition, then visibility hidden - removes from tabIndex list
setTimeout
(()
=>
{
this
.
_isVisible
=
false
;
this
.
updateButtons
();
dom
.
removeClass
(
this
.
_innerDomNode
,
'
visible
'
);
},
200
);
}
...
...
@@ -267,6 +275,12 @@ export abstract class SimpleFindWidget extends Widget {
protected
_getCaseSensitiveValue
():
boolean
{
return
this
.
_findInput
.
getCaseSensitive
();
}
private
updateButtons
()
{
let
hasInput
=
this
.
inputValue
.
length
>
0
;
this
.
prevBtn
.
setEnabled
(
this
.
_isVisible
&&
hasInput
&&
this
.
foundMatch
);
this
.
nextBtn
.
setEnabled
(
this
.
_isVisible
&&
hasInput
&&
this
.
foundMatch
);
}
}
// theming
...
...
src/vs/workbench/contrib/terminal/browser/terminalFindWidget.ts
浏览文件 @
d28a7fd5
...
...
@@ -50,8 +50,9 @@ export class TerminalFindWidget extends SimpleFindWidget {
// Ignore input changes for now
const
instance
=
this
.
_terminalService
.
getActiveInstance
();
if
(
instance
!==
null
)
{
instance
.
findNext
(
this
.
inputValue
,
{
regex
:
this
.
_getRegexValue
(),
wholeWord
:
this
.
_getWholeWordValue
(),
caseSensitive
:
this
.
_getCaseSensitiveValue
(),
incremental
:
true
});
return
instance
.
findNext
(
this
.
inputValue
,
{
regex
:
this
.
_getRegexValue
(),
wholeWord
:
this
.
_getWholeWordValue
(),
caseSensitive
:
this
.
_getCaseSensitiveValue
(),
incremental
:
true
});
}
return
false
;
}
protected
onFocusTrackerFocus
()
{
...
...
src/vs/workbench/contrib/webview/browser/webviewFindWidget.ts
浏览文件 @
d28a7fd5
...
...
@@ -44,6 +44,7 @@ export class WebviewFindWidget extends SimpleFindWidget {
}
else
{
this
.
_delegate
.
stopFind
(
false
);
}
return
false
;
}
protected
onFocusTrackerFocus
()
{
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录