Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
292732cd
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,发现更多精彩内容 >>
提交
292732cd
编写于
5月 04, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clarify editor focus related methods
上级
ba50c629
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
48 addition
and
48 deletion
+48
-48
src/vs/editor/browser/controller/coreCommands.ts
src/vs/editor/browser/controller/coreCommands.ts
+1
-1
src/vs/editor/browser/editorBrowser.ts
src/vs/editor/browser/editorBrowser.ts
+5
-5
src/vs/editor/browser/services/abstractCodeEditorService.ts
src/vs/editor/browser/services/abstractCodeEditorService.ts
+1
-1
src/vs/editor/browser/widget/codeEditorWidget.ts
src/vs/editor/browser/widget/codeEditorWidget.ts
+10
-10
src/vs/editor/browser/widget/diffEditorWidget.ts
src/vs/editor/browser/widget/diffEditorWidget.ts
+2
-2
src/vs/editor/browser/widget/diffReview.ts
src/vs/editor/browser/widget/diffReview.ts
+2
-2
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+2
-2
src/vs/editor/contrib/clipboard/clipboard.ts
src/vs/editor/contrib/clipboard/clipboard.ts
+1
-1
src/vs/editor/contrib/find/findWidget.ts
src/vs/editor/contrib/find/findWidget.ts
+1
-1
src/vs/editor/contrib/multicursor/multicursor.ts
src/vs/editor/contrib/multicursor/multicursor.ts
+1
-1
src/vs/editor/contrib/referenceSearch/referencesController.ts
...vs/editor/contrib/referenceSearch/referencesController.ts
+1
-1
src/vs/editor/contrib/rename/renameInputField.ts
src/vs/editor/contrib/rename/renameInputField.ts
+1
-1
src/vs/editor/contrib/suggest/suggestWidget.ts
src/vs/editor/contrib/suggest/suggestWidget.ts
+1
-1
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+7
-7
src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts
...nch/api/electron-browser/mainThreadDocumentsAndEditors.ts
+1
-1
src/vs/workbench/api/electron-browser/mainThreadEditor.ts
src/vs/workbench/api/electron-browser/mainThreadEditor.ts
+3
-3
src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts
...rkbench/api/electron-browser/mainThreadSaveParticipant.ts
+1
-1
src/vs/workbench/browser/parts/editor/textEditor.ts
src/vs/workbench/browser/parts/editor/textEditor.ts
+3
-3
src/vs/workbench/parts/preferences/browser/preferencesEditor.ts
.../workbench/parts/preferences/browser/preferencesEditor.ts
+2
-2
src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts
...orkbench/parts/scm/electron-browser/dirtydiffDecorator.ts
+1
-1
src/vs/workbench/parts/search/browser/searchView.ts
src/vs/workbench/parts/search/browser/searchView.ts
+1
-1
未找到文件。
src/vs/editor/browser/controller/coreCommands.ts
浏览文件 @
292732cd
...
...
@@ -1651,7 +1651,7 @@ class EditorOrNativeTextInputCommand extends Command {
let
focusedEditor
=
findFocusedEditor
(
accessor
);
// Only if editor text focus (i.e. not if editor has widget focus).
if
(
focusedEditor
&&
focusedEditor
.
isFocused
())
{
if
(
focusedEditor
&&
focusedEditor
.
hasTextFocus
())
{
return
this
.
_runEditorHandler
(
focusedEditor
,
args
);
}
...
...
src/vs/editor/browser/editorBrowser.ts
浏览文件 @
292732cd
...
...
@@ -365,12 +365,12 @@ export interface ICodeEditor extends editorCommon.IEditor {
*/
onDidChangeModelDecorations
(
listener
:
(
e
:
IModelDecorationsChangedEvent
)
=>
void
):
IDisposable
;
/**
* An event emitted when the text inside this editor gained focus (i.e. cursor blinking).
* An event emitted when the text inside this editor gained focus (i.e. cursor
starts
blinking).
* @event
*/
onDidFocusEditorText
(
listener
:
()
=>
void
):
IDisposable
;
/**
* An event emitted when the text inside this editor lost focus.
* An event emitted when the text inside this editor lost focus
(i.e. cursor stops blinking)
.
* @event
*/
onDidBlurEditorText
(
listener
:
()
=>
void
):
IDisposable
;
...
...
@@ -378,12 +378,12 @@ export interface ICodeEditor extends editorCommon.IEditor {
* An event emitted when the text inside this editor or an editor widget gained focus.
* @event
*/
onDidFocusEditor
(
listener
:
()
=>
void
):
IDisposable
;
onDidFocusEditor
Widget
(
listener
:
()
=>
void
):
IDisposable
;
/**
* An event emitted when the text inside this editor or an editor widget lost focus.
* @event
*/
onDidBlurEditor
(
listener
:
()
=>
void
):
IDisposable
;
onDidBlurEditor
Widget
(
listener
:
()
=>
void
):
IDisposable
;
/**
* An event emitted before interpreting typed characters (on the keyboard).
* @event
...
...
@@ -477,7 +477,7 @@ export interface ICodeEditor extends editorCommon.IEditor {
restoreViewState
(
state
:
editorCommon
.
ICodeEditorViewState
):
void
;
/**
* Returns true if th
is editor or one of its widgets has keyboard
focus.
* Returns true if th
e text inside this editor or an editor widget has
focus.
*/
hasWidgetFocus
():
boolean
;
...
...
src/vs/editor/browser/services/abstractCodeEditorService.ts
浏览文件 @
292732cd
...
...
@@ -84,7 +84,7 @@ export abstract class AbstractCodeEditorService implements ICodeEditorService {
for
(
let
i
=
0
;
i
<
editors
.
length
;
i
++
)
{
let
editor
=
editors
[
i
];
if
(
editor
.
isFocused
())
{
if
(
editor
.
hasTextFocus
())
{
// bingo!
return
editor
;
}
...
...
src/vs/editor/browser/widget/codeEditorWidget.ts
浏览文件 @
292732cd
...
...
@@ -115,9 +115,9 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
public
readonly
onDidFocusEditorText
:
Event
<
void
>
=
this
.
_editorTextFocus
.
onDidChangeToTrue
;
public
readonly
onDidBlurEditorText
:
Event
<
void
>
=
this
.
_editorTextFocus
.
onDidChangeToFalse
;
private
_editorFocus
:
BooleanEventEmitter
=
this
.
_register
(
new
BooleanEventEmitter
());
public
readonly
onDidFocusEditor
:
Event
<
void
>
=
this
.
_editor
Focus
.
onDidChangeToTrue
;
public
readonly
onDidBlurEditor
:
Event
<
void
>
=
this
.
_editor
Focus
.
onDidChangeToFalse
;
private
_editor
Widget
Focus
:
BooleanEventEmitter
=
this
.
_register
(
new
BooleanEventEmitter
());
public
readonly
onDidFocusEditor
Widget
:
Event
<
void
>
=
this
.
_editorWidget
Focus
.
onDidChangeToTrue
;
public
readonly
onDidBlurEditor
Widget
:
Event
<
void
>
=
this
.
_editorWidget
Focus
.
onDidChangeToFalse
;
private
readonly
_onWillType
:
Emitter
<
string
>
=
this
.
_register
(
new
Emitter
<
string
>
());
public
readonly
onWillType
=
this
.
_onWillType
.
event
;
...
...
@@ -246,7 +246,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
this
.
_focusTracker
=
new
CodeEditorWidgetFocusTracker
(
domElement
);
this
.
_focusTracker
.
onChange
(()
=>
{
this
.
_editorFocus
.
setValue
(
this
.
_focusTracker
.
hasFocus
());
this
.
_editor
Widget
Focus
.
setValue
(
this
.
_focusTracker
.
hasFocus
());
});
this
.
contentWidgets
=
{};
...
...
@@ -1109,7 +1109,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
this
.
_view
.
focus
();
}
public
isFocused
():
boolean
{
public
hasTextFocus
():
boolean
{
return
this
.
hasView
&&
this
.
_view
.
isFocused
();
}
...
...
@@ -1418,7 +1418,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
viewEventBus
.
onDidGainFocus
=
()
=>
{
this
.
_editorTextFocus
.
setValue
(
true
);
// In IE, the focus is not synchronous, so we give it a little help
this
.
_editorFocus
.
setValue
(
true
);
this
.
_editor
Widget
Focus
.
setValue
(
true
);
};
viewEventBus
.
onDidScroll
=
(
e
)
=>
this
.
_onDidScrollChange
.
fire
(
e
);
...
...
@@ -1563,8 +1563,8 @@ class EditorContextKeysManager extends Disposable {
this
.
_register
(
this
.
_editor
.
onDidChangeConfiguration
(()
=>
this
.
_updateFromConfig
()));
this
.
_register
(
this
.
_editor
.
onDidChangeCursorSelection
(()
=>
this
.
_updateFromSelection
()));
this
.
_register
(
this
.
_editor
.
onDidFocusEditor
(()
=>
this
.
_updateFromFocus
()));
this
.
_register
(
this
.
_editor
.
onDidBlurEditor
(()
=>
this
.
_updateFromFocus
()));
this
.
_register
(
this
.
_editor
.
onDidFocusEditor
Widget
(()
=>
this
.
_updateFromFocus
()));
this
.
_register
(
this
.
_editor
.
onDidBlurEditor
Widget
(()
=>
this
.
_updateFromFocus
()));
this
.
_register
(
this
.
_editor
.
onDidFocusEditorText
(()
=>
this
.
_updateFromFocus
()));
this
.
_register
(
this
.
_editor
.
onDidBlurEditorText
(()
=>
this
.
_updateFromFocus
()));
...
...
@@ -1593,8 +1593,8 @@ class EditorContextKeysManager extends Disposable {
private
_updateFromFocus
():
void
{
this
.
_editorFocus
.
set
(
this
.
_editor
.
hasWidgetFocus
()
&&
!
this
.
_editor
.
isSimpleWidget
);
this
.
_editorTextFocus
.
set
(
this
.
_editor
.
isFocused
()
&&
!
this
.
_editor
.
isSimpleWidget
);
this
.
_textInputFocus
.
set
(
this
.
_editor
.
isFocused
());
this
.
_editorTextFocus
.
set
(
this
.
_editor
.
hasTextFocus
()
&&
!
this
.
_editor
.
isSimpleWidget
);
this
.
_textInputFocus
.
set
(
this
.
_editor
.
hasTextFocus
());
}
}
...
...
src/vs/editor/browser/widget/diffEditorWidget.ts
浏览文件 @
292732cd
...
...
@@ -749,8 +749,8 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
this
.
modifiedEditor
.
focus
();
}
public
isFocused
():
boolean
{
return
this
.
originalEditor
.
isFocused
()
||
this
.
modifiedEditor
.
isFocused
();
public
hasTextFocus
():
boolean
{
return
this
.
originalEditor
.
hasTextFocus
()
||
this
.
modifiedEditor
.
hasTextFocus
();
}
public
onVisible
():
void
{
...
...
src/vs/editor/browser/widget/diffReview.ts
浏览文件 @
292732cd
...
...
@@ -124,12 +124,12 @@ export class DiffReview extends Disposable {
}
this
.
_render
();
}));
this
.
_register
(
diffEditor
.
getOriginalEditor
().
onDidFocusEditor
(()
=>
{
this
.
_register
(
diffEditor
.
getOriginalEditor
().
onDidFocusEditor
Widget
(()
=>
{
if
(
this
.
_isVisible
)
{
this
.
hide
();
}
}));
this
.
_register
(
diffEditor
.
getModifiedEditor
().
onDidFocusEditor
(()
=>
{
this
.
_register
(
diffEditor
.
getModifiedEditor
().
onDidFocusEditor
Widget
(()
=>
{
if
(
this
.
_isVisible
)
{
this
.
hide
();
}
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
292732cd
...
...
@@ -291,9 +291,9 @@ export interface IEditor {
focus
():
void
;
/**
* Returns true if th
is editor has keyboard focus (e.g
. cursor is blinking).
* Returns true if th
e text inside this editor is focused (i.e
. cursor is blinking).
*/
isFocused
():
boolean
;
hasTextFocus
():
boolean
;
/**
* Returns all actions associated with this editor.
...
...
src/vs/editor/contrib/clipboard/clipboard.ts
浏览文件 @
292732cd
...
...
@@ -42,7 +42,7 @@ abstract class ExecCommandAction extends EditorAction {
public
runCommand
(
accessor
:
ServicesAccessor
,
args
:
any
):
void
{
let
focusedEditor
=
accessor
.
get
(
ICodeEditorService
).
getFocusedCodeEditor
();
// Only if editor text focus (i.e. not if editor has widget focus).
if
(
focusedEditor
&&
focusedEditor
.
isFocused
())
{
if
(
focusedEditor
&&
focusedEditor
.
hasTextFocus
())
{
focusedEditor
.
trigger
(
'
keyboard
'
,
this
.
id
,
args
);
return
;
}
...
...
src/vs/editor/contrib/find/findWidget.ts
浏览文件 @
292732cd
...
...
@@ -155,7 +155,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
this
.
_updateToggleSelectionFindButton
();
}
}));
this
.
_register
(
this
.
_codeEditor
.
onDidFocusEditor
(()
=>
{
this
.
_register
(
this
.
_codeEditor
.
onDidFocusEditor
Widget
(()
=>
{
if
(
this
.
_isVisible
)
{
let
globalBufferTerm
=
this
.
_controller
.
getGlobalBufferTerm
();
if
(
globalBufferTerm
&&
globalBufferTerm
!==
this
.
_state
.
searchString
)
{
...
...
src/vs/editor/contrib/multicursor/multicursor.ts
浏览文件 @
292732cd
...
...
@@ -156,7 +156,7 @@ export class MultiCursorSession {
// - focus is not in the editor (i.e. it is in the find widget)
// - and the search widget is visible
// - and the search string is non-empty
if
(
!
editor
.
isFocused
()
&&
findState
.
isRevealed
&&
findState
.
searchString
.
length
>
0
)
{
if
(
!
editor
.
hasTextFocus
()
&&
findState
.
isRevealed
&&
findState
.
searchString
.
length
>
0
)
{
// Find widget owns what is searched for
return
new
MultiCursorSession
(
editor
,
findController
,
false
,
findState
.
searchString
,
findState
.
wholeWord
,
findState
.
matchCase
,
null
);
}
...
...
src/vs/editor/contrib/referenceSearch/referencesController.ts
浏览文件 @
292732cd
...
...
@@ -179,7 +179,7 @@ export abstract class ReferencesController implements editorCommon.IEditorContri
if
(
this
.
_model
)
{
// can be called while still resolving...
let
source
=
this
.
_model
.
nearestReference
(
this
.
_editor
.
getModel
().
uri
,
this
.
_widget
.
position
);
let
target
=
this
.
_model
.
nextOrPreviousReference
(
source
,
fwd
);
let
editorFocus
=
this
.
_editor
.
isFocused
();
let
editorFocus
=
this
.
_editor
.
hasTextFocus
();
await
this
.
_widget
.
setSelection
(
target
);
await
this
.
_gotoReference
(
target
);
if
(
editorFocus
)
{
...
...
src/vs/editor/contrib/rename/renameInputField.ts
浏览文件 @
292732cd
...
...
@@ -167,7 +167,7 @@ export default class RenameInputField implements IContentWidget, IDisposable {
};
disposeOnDone
.
push
(
this
.
_editor
.
onDidChangeCursorSelection
(
onCursorChanged
));
disposeOnDone
.
push
(
this
.
_editor
.
onDidBlurEditor
(()
=>
this
.
cancelInput
(
false
)));
disposeOnDone
.
push
(
this
.
_editor
.
onDidBlurEditor
Widget
(()
=>
this
.
cancelInput
(
false
)));
this
.
_show
();
...
...
src/vs/editor/contrib/suggest/suggestWidget.ts
浏览文件 @
292732cd
...
...
@@ -481,7 +481,7 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
}
this
.
editorBlurTimeout
=
TPromise
.
timeout
(
150
).
then
(()
=>
{
if
(
!
this
.
editor
.
isFocused
())
{
if
(
!
this
.
editor
.
hasTextFocus
())
{
this
.
setState
(
State
.
Hidden
);
}
});
...
...
src/vs/monaco.d.ts
浏览文件 @
292732cd
...
...
@@ -2014,9 +2014,9 @@ declare namespace monaco.editor {
*/
focus
():
void
;
/**
* Returns true if th
is editor has keyboard focus (e.g
. cursor is blinking).
* Returns true if th
e text inside this editor is focused (i.e
. cursor is blinking).
*/
isFocused
():
boolean
;
hasTextFocus
():
boolean
;
/**
* Returns all actions associated with this editor.
*/
...
...
@@ -3639,12 +3639,12 @@ declare namespace monaco.editor {
*/
onDidChangeModelDecorations
(
listener
:
(
e
:
IModelDecorationsChangedEvent
)
=>
void
):
IDisposable
;
/**
* An event emitted when the text inside this editor gained focus (i.e. cursor blinking).
* An event emitted when the text inside this editor gained focus (i.e. cursor
starts
blinking).
* @event
*/
onDidFocusEditorText
(
listener
:
()
=>
void
):
IDisposable
;
/**
* An event emitted when the text inside this editor lost focus.
* An event emitted when the text inside this editor lost focus
(i.e. cursor stops blinking)
.
* @event
*/
onDidBlurEditorText
(
listener
:
()
=>
void
):
IDisposable
;
...
...
@@ -3652,12 +3652,12 @@ declare namespace monaco.editor {
* An event emitted when the text inside this editor or an editor widget gained focus.
* @event
*/
onDidFocusEditor
(
listener
:
()
=>
void
):
IDisposable
;
onDidFocusEditor
Widget
(
listener
:
()
=>
void
):
IDisposable
;
/**
* An event emitted when the text inside this editor or an editor widget lost focus.
* @event
*/
onDidBlurEditor
(
listener
:
()
=>
void
):
IDisposable
;
onDidBlurEditor
Widget
(
listener
:
()
=>
void
):
IDisposable
;
/**
* An event emitted on a "mouseup".
* @event
...
...
@@ -3712,7 +3712,7 @@ declare namespace monaco.editor {
*/
restoreViewState
(
state
:
ICodeEditorViewState
):
void
;
/**
* Returns true if th
is editor or one of its widgets has keyboard
focus.
* Returns true if th
e text inside this editor or an editor widget has
focus.
*/
hasWidgetFocus
():
boolean
;
/**
...
...
src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts
浏览文件 @
292732cd
...
...
@@ -244,7 +244,7 @@ class MainThreadDocumentAndEditorStateComputer {
)
{
const
apiEditor
=
new
TextEditorSnapshot
(
editor
);
editors
.
set
(
apiEditor
.
id
,
apiEditor
);
if
(
editor
.
isFocused
())
{
if
(
editor
.
hasTextFocus
())
{
activeEditor
=
apiEditor
.
id
;
}
}
...
...
src/vs/workbench/api/electron-browser/mainThreadEditor.ts
浏览文件 @
292732cd
...
...
@@ -266,10 +266,10 @@ export class MainThreadTextEditor {
this
.
setCodeEditor
(
null
);
}));
this
.
_codeEditorListeners
.
push
(
this
.
_codeEditor
.
onDidFocusEditor
(()
=>
{
this
.
_codeEditorListeners
.
push
(
this
.
_codeEditor
.
onDidFocusEditor
Widget
(()
=>
{
this
.
_focusTracker
.
onGainedFocus
();
}));
this
.
_codeEditorListeners
.
push
(
this
.
_codeEditor
.
onDidBlurEditor
(()
=>
{
this
.
_codeEditorListeners
.
push
(
this
.
_codeEditor
.
onDidBlurEditor
Widget
(()
=>
{
this
.
_focusTracker
.
onLostFocus
();
}));
...
...
@@ -423,7 +423,7 @@ export class MainThreadTextEditor {
public
isFocused
():
boolean
{
if
(
this
.
_codeEditor
)
{
return
this
.
_codeEditor
.
isFocused
();
return
this
.
_codeEditor
.
hasTextFocus
();
}
return
false
;
}
...
...
src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts
浏览文件 @
292732cd
...
...
@@ -92,7 +92,7 @@ function findEditor(model: ITextModel, codeEditorService: ICodeEditorService): I
if
(
model
.
isAttachedToEditor
())
{
for
(
const
editor
of
codeEditorService
.
listCodeEditors
())
{
if
(
editor
.
getModel
()
===
model
)
{
if
(
editor
.
isFocused
())
{
if
(
editor
.
hasTextFocus
())
{
return
editor
;
// favour focused editor if there are multiple
}
...
...
src/vs/workbench/browser/parts/editor/textEditor.ts
浏览文件 @
292732cd
...
...
@@ -140,10 +140,10 @@ export abstract class BaseTextEditor extends BaseEditor {
// Application & Editor focus change to respect auto save settings
if
(
isCodeEditor
(
this
.
editorControl
))
{
this
.
toUnbind
.
push
(
this
.
editorControl
.
onDidBlurEditor
(()
=>
this
.
onEditorFocusLost
()));
this
.
toUnbind
.
push
(
this
.
editorControl
.
onDidBlurEditor
Widget
(()
=>
this
.
onEditorFocusLost
()));
}
else
if
(
isDiffEditor
(
this
.
editorControl
))
{
this
.
toUnbind
.
push
(
this
.
editorControl
.
getOriginalEditor
().
onDidBlurEditor
(()
=>
this
.
onEditorFocusLost
()));
this
.
toUnbind
.
push
(
this
.
editorControl
.
getModifiedEditor
().
onDidBlurEditor
(()
=>
this
.
onEditorFocusLost
()));
this
.
toUnbind
.
push
(
this
.
editorControl
.
getOriginalEditor
().
onDidBlurEditor
Widget
(()
=>
this
.
onEditorFocusLost
()));
this
.
toUnbind
.
push
(
this
.
editorControl
.
getModifiedEditor
().
onDidBlurEditor
Widget
(()
=>
this
.
onEditorFocusLost
()));
}
this
.
toUnbind
.
push
(
this
.
editorGroupService
.
onEditorsChanged
(()
=>
this
.
onEditorFocusLost
()));
...
...
src/vs/workbench/parts/preferences/browser/preferencesEditor.ts
浏览文件 @
292732cd
...
...
@@ -782,7 +782,7 @@ class SideBySidePreferencesWidget extends Widget {
this
.
defaultPreferencesEditor
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
DefaultPreferencesEditor
));
this
.
defaultPreferencesEditor
.
create
(
this
.
defaultPreferencesEditorContainer
);
this
.
defaultPreferencesEditor
.
setVisible
(
true
);
(
<
CodeEditorWidget
>
this
.
defaultPreferencesEditor
.
getControl
()).
onDidFocusEditor
(()
=>
this
.
lastFocusedEditor
=
this
.
defaultPreferencesEditor
);
(
<
CodeEditorWidget
>
this
.
defaultPreferencesEditor
.
getControl
()).
onDidFocusEditor
Widget
(()
=>
this
.
lastFocusedEditor
=
this
.
defaultPreferencesEditor
);
this
.
editablePreferencesEditorContainer
=
DOM
.
append
(
parentElement
,
DOM
.
$
(
'
.editable-preferences-editor-container
'
));
this
.
editablePreferencesEditorContainer
.
style
.
position
=
'
absolute
'
;
...
...
@@ -879,7 +879,7 @@ class SideBySidePreferencesWidget extends Widget {
this
.
editablePreferencesEditor
=
editor
;
this
.
editablePreferencesEditor
.
create
(
this
.
editablePreferencesEditorContainer
);
this
.
editablePreferencesEditor
.
setVisible
(
true
);
(
<
CodeEditorWidget
>
this
.
editablePreferencesEditor
.
getControl
()).
onDidFocusEditor
(()
=>
this
.
lastFocusedEditor
=
this
.
editablePreferencesEditor
);
(
<
CodeEditorWidget
>
this
.
editablePreferencesEditor
.
getControl
()).
onDidFocusEditor
Widget
(()
=>
this
.
lastFocusedEditor
=
this
.
editablePreferencesEditor
);
this
.
lastFocusedEditor
=
this
.
editablePreferencesEditor
;
return
editor
;
...
...
src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts
浏览文件 @
292732cd
...
...
@@ -172,7 +172,7 @@ function getOuterEditorFromDiffEditor(accessor: ServicesAccessor): ICodeEditor {
const
diffEditors
=
accessor
.
get
(
ICodeEditorService
).
listDiffEditors
();
for
(
const
diffEditor
of
diffEditors
)
{
if
(
diffEditor
.
isFocused
()
&&
diffEditor
instanceof
EmbeddedDiffEditorWidget
)
{
if
(
diffEditor
.
hasTextFocus
()
&&
diffEditor
instanceof
EmbeddedDiffEditorWidget
)
{
return
diffEditor
.
getParentEditor
();
}
}
...
...
src/vs/workbench/parts/search/browser/searchView.ts
浏览文件 @
292732cd
...
...
@@ -891,7 +891,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
let
editorControl
=
this
.
editorService
.
getActiveEditor
().
getControl
();
if
(
isDiffEditor
(
editorControl
))
{
if
(
editorControl
.
getOriginalEditor
().
isFocused
())
{
if
(
editorControl
.
getOriginalEditor
().
hasTextFocus
())
{
editorControl
=
editorControl
.
getOriginalEditor
();
}
else
{
editorControl
=
editorControl
.
getModifiedEditor
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录