Skip to content

Commit 245854f

Browse files
AndreasArvidssonpre-commit-ci-lite[bot]phillco
authored
Disable expand to containing token on fallback (#2798)
The fallback code we have tells Talon to expand an empty selection to the containing token. Doing this in the search widget works fine but the little cursor dance we do to select a token completely messes up the file explorer when you're trying to copy or paste a file. #2800 ## 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: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Phil Cohen <[email protected]>
1 parent 9b39cb1 commit 245854f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

data/fixtures/recorded/fallback/takeThis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ finalState:
2222
active: {line: 0, character: 0}
2323
fallback:
2424
action: setSelection
25-
modifiers:
26-
- {type: containingTokenIfEmpty}
25+
modifiers: []

packages/cursorless-engine/src/core/getCommandFallback.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ function getModifiersFromTarget(
142142
return target.modifiers;
143143
}
144144

145-
if (target.mark?.type === "cursor") {
146-
return [{ type: "containingTokenIfEmpty" }];
147-
}
145+
// FIXME: Trying to select a word in the file explorer will create weird behavior.
146+
// https://github.com/cursorless-dev/cursorless/issues/2800
147+
// if (target.mark?.type === "cursor") {
148+
// return [{ type: "containingTokenIfEmpty" }];
149+
// }
148150
}
149151
return [];
150152
}

0 commit comments

Comments
 (0)