diff --git a/vscode/src/Common.ts b/vscode/src/Common.ts index 40e74cf..5349f3a 100644 --- a/vscode/src/Common.ts +++ b/vscode/src/Common.ts @@ -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)