Closed
Description
When I have several tokens selected in the tale of three lines, and I say 'flash every token this' it includes the first token in the last line which is not in the selection. I expected that it would only flash the tokens that were within the selection. I'm including a video so you can see what I'm talking about. Is this the expected behavior?
Screen.Recording.2025-04-15.at.8.29.40.PM.mov
Metadata
Metadata
Assignees
Labels
No labels
Activity
AndreasArvidsson commentedon Apr 16, 2025
The expected behavior is that all tokens on all three lines are flashed. That is the behavior I get when I try this as well.
Let's break down
"flash every token line"
For each selection:
line
. Expand to lineevery token
. Use every tokenflash
: Flash final targets[-]Unexpected token appears to be included when I say 'flash every token line'[/-][+]Unexpected token appears to be included when I say 'flash every token this'[/+]jaresty commentedon Apr 16, 2025
Sorry, I miswrote my original message - I was saying 'flash every token this'
AndreasArvidsson commentedon Apr 16, 2025
That is own purpose, but might be a bit esoteric. The idea is that if you have a single scope selected and issue and every we ignore your current selection.
Code:
cursorless/packages/cursorless-engine/src/processTargets/modifiers/EveryScopeStage.ts
Lines 62 to 71 in 3e8473a
Example test case:
https://github.com/cursorless-dev/cursorless/blob/3e8473a193f775bc3d0a763b4a1f21356b8b1746/data/fixtures/recorded/modifiers/everyScope/clearEveryToken.yml
When you only have a single selection this logic make totally sense, but the behavior with multiple selections is a bit unexpected. @pokey How do you feel about different behaviors depending on if you have one or many input targets?
pokey commentedon Apr 16, 2025
Yeah I've always had mixed feelings about that heuristic. Multiple cursors is not a terrible idea for when to drop the heuristic, tho do we have that information easily available at the modifier stage?
AndreasArvidsson commentedon Apr 16, 2025
Not today. This would be a change to pass that additional information.
jaresty commentedon Apr 17, 2025
For what it's worth it does seem to preserve the selection for the first set of cursors and only ignores the selection for the last one (which agrees with your description above, but is definitely a little bit odd- as an experience)
AndreasArvidsson commentedon Apr 17, 2025
Yeah that is not good UX. Here is a fix
#2893
Don't discard everyScope selections for multiple targets (#2893)