Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5dd868c5
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,发现更多精彩内容 >>
提交
5dd868c5
编写于
6月 30, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #8404: find in selection activates only through its button
上级
2470fe43
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
31 deletion
+9
-31
src/vs/editor/contrib/find/browser/findWidget.ts
src/vs/editor/contrib/find/browser/findWidget.ts
+4
-14
src/vs/editor/contrib/find/common/findController.ts
src/vs/editor/contrib/find/common/findController.ts
+5
-15
src/vs/editor/contrib/find/common/findState.ts
src/vs/editor/contrib/find/common/findState.ts
+0
-2
未找到文件。
src/vs/editor/contrib/find/browser/findWidget.ts
浏览文件 @
5dd868c5
...
...
@@ -71,8 +71,6 @@ export class FindWidget extends Widget implements IOverlayWidget {
private
_isVisible
:
boolean
;
private
_isReplaceVisible
:
boolean
;
private
focusTracker
:
dom
.
IFocusTracker
;
constructor
(
codeEditor
:
ICodeEditor
,
controller
:
IFindController
,
...
...
@@ -95,9 +93,6 @@ export class FindWidget extends Widget implements IOverlayWidget {
this
.
_buildDomNode
();
this
.
_updateButtons
();
this
.
focusTracker
=
this
.
_register
(
dom
.
trackFocus
(
this
.
_findInput
.
inputBox
.
inputElement
));
this
.
focusTracker
.
addFocusListener
(()
=>
this
.
_reseedFindScope
());
this
.
_register
(
this
.
_codeEditor
.
onDidChangeConfiguration
((
e
:
IConfigurationChangedEvent
)
=>
{
if
(
e
.
readOnly
)
{
if
(
this
.
_codeEditor
.
getConfiguration
().
readOnly
)
{
...
...
@@ -116,14 +111,6 @@ export class FindWidget extends Widget implements IOverlayWidget {
this
.
_codeEditor
.
addOverlayWidget
(
this
);
}
private
_reseedFindScope
():
void
{
let
selection
=
this
.
_codeEditor
.
getSelection
();
if
(
selection
.
startLineNumber
!==
selection
.
endLineNumber
)
{
// Reseed find scope
this
.
_state
.
change
({
searchScope
:
selection
},
true
);
}
}
// ----- IOverlayWidget API
public
getId
():
string
{
...
...
@@ -461,7 +448,10 @@ export class FindWidget extends Widget implements IOverlayWidget {
title
:
NLS_TOGGLE_SELECTION_FIND_TITLE
,
onChange
:
()
=>
{
if
(
this
.
_toggleSelectionFind
.
checked
)
{
this
.
_reseedFindScope
();
let
selection
=
this
.
_codeEditor
.
getSelection
();
if
(
!
selection
.
isEmpty
())
{
this
.
_state
.
change
({
searchScope
:
selection
},
true
);
}
}
else
{
this
.
_state
.
change
({
searchScope
:
null
},
true
);
}
...
...
src/vs/editor/contrib/find/common/findController.ts
浏览文件 @
5dd868c5
...
...
@@ -30,7 +30,6 @@ export enum FindStartFocusAction {
export
interface
IFindStartOptions
{
forceRevealReplace
:
boolean
;
seedSearchStringFromSelection
:
boolean
;
seedSearchScopeFromSelection
:
boolean
;
shouldFocus
:
FindStartFocusAction
;
shouldAnimate
:
boolean
;
}
...
...
@@ -65,13 +64,16 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
this
.
disposeModel
();
this
.
_state
.
change
({
searchScope
:
null
},
false
);
if
(
shouldRestartFind
)
{
this
.
_start
({
forceRevealReplace
:
false
,
seedSearchStringFromSelection
:
false
,
seedSearchScopeFromSelection
:
false
,
shouldFocus
:
FindStartFocusAction
.
NoFocusChange
,
shouldAnimate
:
false
shouldAnimate
:
false
,
});
}
}));
...
...
@@ -170,14 +172,6 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
}
}
let
selection
=
this
.
_editor
.
getSelection
();
stateChanges
.
searchScope
=
null
;
if
(
opts
.
seedSearchScopeFromSelection
&&
selection
.
startLineNumber
<
selection
.
endLineNumber
)
{
// Take search scope into account only if it is more than one line.
stateChanges
.
searchScope
=
selection
;
}
// Overwrite isReplaceRevealed
if
(
opts
.
forceRevealReplace
)
{
stateChanges
.
isReplaceRevealed
=
true
;
...
...
@@ -247,7 +241,6 @@ export class StartFindAction extends EditorAction {
controller
.
start
({
forceRevealReplace
:
false
,
seedSearchStringFromSelection
:
true
,
seedSearchScopeFromSelection
:
true
,
shouldFocus
:
FindStartFocusAction
.
FocusFindInput
,
shouldAnimate
:
true
});
...
...
@@ -266,7 +259,6 @@ export abstract class MatchFindAction extends EditorAction {
controller
.
start
({
forceRevealReplace
:
false
,
seedSearchStringFromSelection
:
(
controller
.
getState
().
searchString
.
length
===
0
),
seedSearchScopeFromSelection
:
false
,
shouldFocus
:
FindStartFocusAction
.
NoFocusChange
,
shouldAnimate
:
true
});
...
...
@@ -305,7 +297,6 @@ export abstract class SelectionMatchFindAction extends EditorAction {
controller
.
start
({
forceRevealReplace
:
false
,
seedSearchStringFromSelection
:
false
,
seedSearchScopeFromSelection
:
false
,
shouldFocus
:
FindStartFocusAction
.
NoFocusChange
,
shouldAnimate
:
true
});
...
...
@@ -340,7 +331,6 @@ export class StartFindReplaceAction extends EditorAction {
controller
.
start
({
forceRevealReplace
:
true
,
seedSearchStringFromSelection
:
true
,
seedSearchScopeFromSelection
:
true
,
shouldFocus
:
FindStartFocusAction
.
FocusReplaceInput
,
shouldAnimate
:
true
});
...
...
src/vs/editor/contrib/find/common/findState.ts
浏览文件 @
5dd868c5
...
...
@@ -32,8 +32,6 @@ export interface INewFindReplaceState {
wholeWord
?:
boolean
;
matchCase
?:
boolean
;
searchScope
?:
Range
;
// matchesPosition?: number;
// matchesCount?: number;
}
export
class
FindReplaceState
implements
IDisposable
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录