mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-07-28 04:08:05 +00:00
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:
committed by
David Lechner
parent
ef294f326e
commit
be32c37f18
@@ -4,6 +4,9 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
- Focus editor when new file is opened.
|
||||
|
||||
## [2.2.0-beta.1] - 2023-03-08
|
||||
|
||||
### Added
|
||||
|
||||
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user