Skip to content

Commit

Permalink
Merge pull request #108 from thien-do/feat/focus_editor_on_open_new
Browse files Browse the repository at this point in the history
Focus editor on open file
  • Loading branch information
thien-do authored Sep 26, 2021
2 parents b842ae7 + 6f57d2e commit ce4375a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/app/utils/open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const updateEditor = async (params: Params): Promise<void> => {
const text = fileModel === null ? "" : await fileModel.text();
const model = monaco.editor.createModel(text, "markdown");
editor.setModel(model);
setTimeout(() => editor.focus(), 0);
};

/**
Expand Down

0 comments on commit ce4375a

Please sign in to comment.