Skip to content

Commit cffcdf7

Browse files
Clean up
1 parent ef4a4f0 commit cffcdf7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,14 @@ abstract class BringMoveSwap {
9191
} else {
9292
text = source.contentText;
9393
}
94+
95+
// Add destination edit
9496
destinationEdit = {
9597
edit: destination.constructChangeEdit(text),
9698
editor: destination.editor,
9799
originalTarget: destination.target,
98100
isSource: false,
99101
};
100-
// Add destination edit
101102
results.push(destinationEdit);
102103
} else {
103104
destination = destinations[0];
@@ -108,12 +109,14 @@ abstract class BringMoveSwap {
108109
if (!usedSources.includes(source)) {
109110
// Allow move where the destination contains the source. eg "bring token to line"
110111
if (
112+
this.type !== "move" ||
111113
destinationEdit == null ||
112114
destinationEdit.editor.id !== source.editor.id ||
113115
!destinationEdit.edit.range.contains(source.contentRange)
114116
) {
115117
usedSources.push(source);
116118
}
119+
117120
if (this.type === "bring") {
118121
results.push({
119122
edit: source

0 commit comments

Comments
 (0)