-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add proper "jump back" command #190
Comments
I vote for this! |
To be clear this would be a special target? |
It would be a special mark. Will be best to do as part of #191 |
Ok actually I take it back. No need to go super general. I'd just get something working for a start. I'd start by copying https://github.com/cursorless-dev/cursorless/blob/main/src/core/IndividualHatMap.ts The important thing is to register your ranges with the range updater to ensure that they stay up to date as the document changes. See https://github.com/cursorless-dev/cursorless/blob/main/src/core/IndividualHatMap.ts#L30 to see where it is called there, and also the docs |
Some things to keep in mind:
|
Heyo @pokey, here's a few notes/questions
✅
❓I'm curious about this one, the description implies that we should use this for just a subset of actions. What in your mind are hacked actions?
✅
✅ / ❓ Makes sense to me. Will we have to check DFA/public on this one? Some edge cases to think about:
|
What is "this" here? "back" will just be a mark which refers to the previous cursor location, so can be used for any action. The stack of previous cursor locations will be populated by listening for any changes to the selection, no matter where they come from. However, there are certain cases we want to avoid things ending up on the cursor location stack, because the cursor movement is transient. These examples are the "hacked" actions I mentioned, where we move the cursor because there is no properly cursorless way of doing them. For example, today the "copy" action is implemented by moving the cursor, copying, then moving the cursor back. For this case, it is confusing if the location that the cursor moved is on the previous location stack, because from the user's perspective the cursor never moved make sense?
Should have no DFA impact because it's an independent command
Two stacks is an interesting idea.
So there will be two things: "back" the mark and "back" the command. We might call them two different things tbh. Maybe "last" for the mark, and "back" for the command. The mark can pair with anything because it's just a mark, the command is just a standalone command that moves cursor and pops stack so doesn't really pair with anything "
I'd just let the range updater handle this one for now. If it becomes annoying we can figure out removing from the stack
Yeah we just keep the range, and let the range updater keep it up to date as the document evolves |
Every time you issue "pre", "post", "take", or "clear", it will capture previous cursor location and keep it up to date
Can use "bounce" or just "back" for this one
Would also want to support "bring air back", eg without "to"
The text was updated successfully, but these errors were encountered: