editor/sagas: focus editor when activated

When a file is activated, it is an indication that the user wants to
edit the file right now, so the editor should be focused.
This commit is contained in:
David Lechner
2023-03-28 10:44:23 -05:00
committed by David Lechner
parent ef294f326e
commit be32c37f18
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -4,6 +4,9 @@
## [Unreleased]
### Changed
- Focus editor when new file is opened.
## [2.2.0-beta.1] - 2023-03-08
### Added
+2
View File
@@ -238,6 +238,8 @@ function* handleEditorActivateFile(
editor.restoreViewState(file.viewState);
activeFileHistory.push(action.uuid);
editor.focus();
yield* put(editorDidActivateFile(action.uuid));
} catch (err) {
yield* put(editorDidFailToActivateFile(action.uuid, ensureError(err)));