aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/src/source_change.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/editors/code/src/source_change.ts b/editors/code/src/source_change.ts
index 399a150c6..af8f1df51 100644
--- a/editors/code/src/source_change.ts
+++ b/editors/code/src/source_change.ts
@@ -37,11 +37,13 @@ export async function applySourceChange(ctx: Ctx, change: ra.SourceChange) {
37 toReveal.position, 37 toReveal.position,
38 ); 38 );
39 const editor = vscode.window.activeTextEditor; 39 const editor = vscode.window.activeTextEditor;
40 if (!editor || editor.document.uri.toString() !== uri.toString()) { 40 if (!editor || !editor.selection.isEmpty) {
41 return; 41 return;
42 } 42 }
43 if (!editor.selection.isEmpty) { 43
44 return; 44 if (editor.document.uri !== uri) {
45 const doc = await vscode.workspace.openTextDocument(uri);
46 await vscode.window.showTextDocument(doc);
45 } 47 }
46 editor.selection = new vscode.Selection(position, position); 48 editor.selection = new vscode.Selection(position, position);
47 editor.revealRange( 49 editor.revealRange(