mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-26 04:34:32 +00:00
Fix problem where the editor would not emit a focus loss event when the model would be cleared (#244443)
This commit is contained in:
@@ -498,8 +498,16 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
const hasTextFocus = this.hasTextFocus();
|
||||
const detachedModel = this._detachModel();
|
||||
this._attachModel(model);
|
||||
if (hasTextFocus && this.hasModel()) {
|
||||
this.focus();
|
||||
if (this.hasModel()) {
|
||||
// we have a new model (with a new view)!
|
||||
if (hasTextFocus) {
|
||||
this.focus();
|
||||
}
|
||||
} else {
|
||||
// we have no model (and no view) anymore
|
||||
// make sure the outside world knows we are not focused
|
||||
this._editorTextFocus.setValue(false);
|
||||
this._editorWidgetFocus.setValue(false);
|
||||
}
|
||||
|
||||
this._removeDecorationTypes();
|
||||
|
||||
Reference in New Issue
Block a user