sapling
sapling copied to clipboard
Have undo and redo keep the cursor in the same/similar position in the tree
if the undo prevents the node the cursor is on from existing, it should move to the parent.
Alternatively, undo/redo could move the cursor to the site of the undone/redone edit. This is probably more consistent with other editors.
@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.