Skip to content
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

Have undo and redo keep the cursor in the same/similar position in the tree #27

Open
Protowalker opened this issue Nov 30, 2020 · 3 comments

Comments

@Protowalker
Copy link
Contributor

No description provided.

@Protowalker
Copy link
Contributor Author

if the undo prevents the node the cursor is on from existing, it should move to the parent.

@HactarCE
Copy link
Contributor

HactarCE commented Nov 30, 2020

Alternatively, undo/redo could move the cursor to the site of the undone/redone edit. This is probably more consistent with other editors.

@kneasle
Copy link
Owner

kneasle commented Nov 30, 2020

@HactarCE's suggestion is what Sapling should currently do (though there's currently no integration-style unit tests so I can't be sure). The way Sapling currently implements this is to save the location of the cursor along with the root for every undo step - this way, undo/redo will move the cursor to the location of the edit.

However, I'd like Sapling to have multiple selections and cursors (cos it's just an awesome feature that's way easier to add early on in development). In this case, saving the cursor locations is the most intuitive way to deal with multiple selections. It's also what Kakoune does.

But I'm open to ideas and discussion - Sapling is an experiment so anything goes as far as ideas are concerned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants