Skip to content

Commit b923563

Browse files
Removed reveal line for insert copy action (#1579)
Fixes #1437 ## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [ ] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [ ] I have not broken the cheatsheet --------- Co-authored-by: Pokey Rule <[email protected]>
1 parent 037389f commit b923563

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/cursorless-engine/src/actions/InsertCopy.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,16 @@ class InsertCopy implements Action {
8787
);
8888

8989
setSelectionsWithoutFocusingEditor(editableEditor, updatedEditorSelections);
90-
await editableEditor.revealRange(editor.selections[0]);
90+
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+
}
91100

92101
return {
93102
sourceMark: createThatMark(targets, insertionRanges),

0 commit comments

Comments
 (0)