-
-
Notifications
You must be signed in to change notification settings - Fork 84
Don't discard everyScope selections for multiple targets #2893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow this touched a lot of code for such a small edge case. Would it make any sense to pass into the stage constructor instead? Would that help?
I'm also not totally convinced by this fix. Eg what if you have
aaa bbb
ccc ddd
And you say "take bat and drum" and then say "take first token". Would you really expect that to behave differently from "take bat" followed by "take first token"?
I think a better heuristic would be whether all the inputs have the same number of scopes. Ie our current hack/heuristic should either apply to all input targets or none. But that does start to feel maybe hard to reason about?
I don't think that would touch less files. There's a lot of instances where we create a modifier stage and then call it directly after.
True
You mean we would actually run the modify stage on each target and then compare the results. If needed rerun the state with different settings? This would be a level of interaction between the different paths of our pipeline we have never done before. I'm not sure if that is simpler or more complicated for the user either. |
@pokey I thought some more on the idea of the different instances of the modifier being more aware of each other. My first was to add a optional function cursorless/packages/cursorless-engine/src/processTargets/modifiers/targetSequenceUtils.ts Lines 38 to 48 in e5e9929
|
Unfortunately became quite a lot of changes to pass the modifier options, but I think this is the only way. It also opens up for more context aware modifiers in the future.
Fixes #2889