Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Commit

Permalink
Focus editor on "editor.focus.gain" message received.
Browse files Browse the repository at this point in the history
Send 'editor.focus.gained' message on editor focus received.
  • Loading branch information
himchev committed Mar 25, 2022
1 parent 6f17779 commit 9dd9725
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ide-monaco/js/editor.js
Expand Up @@ -693,6 +693,18 @@ function isDirty(model) {
}
}, "workbench.editor.save");

messageHub.subscribe(function (msg) {
let file = msg.data.file;
if (file !== fileName)
return;

_editor.focus();
}, "editor.focus.gain");

_editor.onDidFocusEditorText(function () {
messageHub.post({ data: { file: fileName } }, 'editor.focus.gained');
});

_editor.onDidChangeModel(function () {
if (_fileObject.isGit) {
lineDecorations = highlight_changed(
Expand Down

0 comments on commit 9dd9725

Please sign in to comment.