Skip to content

Commit

Permalink
VSC: Attempt to prevent rare "TextEditor has been disposed" error (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
stkb committed Jan 17, 2022
1 parent 6570013 commit 6313111
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vscode/src/Common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export function applyEdit (editor, edit) {
})
.then(didEdit => {
if(!didEdit) return
// Try to prevent rare "TextEditor has been disposed" error
if(editor !== window.activeTextEditor) return
if(wholeDocSelected) {
const wholeRange = getDocRange()
editor.selection = new Selection(wholeRange.start, wholeRange.end)
Expand Down

0 comments on commit 6313111

Please sign in to comment.