We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 037389f commit b923563Copy full SHA for b923563
packages/cursorless-engine/src/actions/InsertCopy.ts
@@ -87,7 +87,16 @@ class InsertCopy implements Action {
87
);
88
89
setSelectionsWithoutFocusingEditor(editableEditor, updatedEditorSelections);
90
- await editableEditor.revealRange(editor.selections[0]);
+ const primarySelection = editor.selections[0];
91
+
92
+ if (
93
+ updatedContentSelections.some(
94
+ (selection) => selection.intersection(primarySelection) != null,
95
+ )
96
+ ) {
97
+ // If the original target contained the user's cursor, reveal it in case it got pushed off screen
98
+ await editableEditor.revealRange(primarySelection);
99
+ }
100
101
return {
102
sourceMark: createThatMark(targets, insertionRanges),
0 commit comments