3 ms·
Agreed. When I write "foobar", delete the last three characters (so that now I have "foo", then I write a "t", I would like to be able to undo the previous del
by perlgeek 4y ago
Agreed.
When I write "foobar", delete the last three characters (so that now I have "foo", then I write a "t", I would like to be able to undo the previous deletion (giving me "footbar"), not just adding the last character.
Seems to me that would work especially well in editors that have the concept of verbs + objects, like vim's "delete until the end of the line" or "replace current word with...", but maybe it would work with all kinds of editors?
- chongli 4y agoShould it be “footbar”? Or “foobart”? I could see a case being made for either.
- mananaysiempre 4y agofoo<<<bar===t>>> I’m kidding, but only a bit: the (in hindsight, reasonable) lesson of the Pijul paper[1] is that if you want to do the most general merge and (therefore) avoid any arbitrary choices, you’re forced to extend your model from consistent files as sequences to files potentially containing conflicts as DAGs (or something even more complicated if you have data more complex than a single flat sequence or edits other than insertions). Or you can very carefully make a consistent set of arbitrary choices, like implementations of operational transformation usually do. [1] https://doi.org/10.1016/j.entcs.2013.09.018 https://doi.org/10.1016/j.entcs.2013.09.018
- perlgeek 4y agoDepends on where the cursor is when you press redo, because it was originally inserted at the cursor position.
- chongli 4y agoI would definitely not want the behaviour of undo/redo to depend on the current position of the cursor; that’s what paste is for.