-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
More granular undo #1583
Comments
I agree what you say. |
See #1142 |
This issue should probably be closed as a duplicate. |
The time based undo in the other issue is a rather new approach and is a bit unpredictable and also potentially fits too much text (when you type without interruptions) into a single undo vs the usual text units-based undo proposed here, so not really a duplicate |
Oh, true. |
What about implementing save-based undo? Like vim |
|
It's a good command that's worth implementing (and I like it better than undos based on time as I can have a better mental model of saving after some logical chunk of work rather than trying to guess how much time that chunk of work took), but it operates on a different "time frame": it's suitable to undo big chunks of edits you've committed to a file, but unsuitable for smaller changes of the last few words/sentences/edits. |
and a text editor isn't git, so not sure how that's relevant, we'd better use text editing experience from other apps for comparison. |
We do. Helix has roots from Vim and Kakoune which have matching behavior. Having to press
That's sort of the point though, You can delete back by one word via
|
But you don't need to do that! I'm not proposing you to remove all the other undo operations, so we can continue to press a single button to undo a whole chunk of text (e.g., execute an imaginary
So do I, until I don't and type whole sentences/paragraphs without any edits (sometimes even leaving fixing typos for later to avoid interrupting the flow). What's the value of being able to wipe out the changes only by sentences/paragraphs of text or having to break the flow to add undo points manually?
The modality is the point of this model, and it brings with it a host of benefits like the ability to bind a command to a single key without modifiers (and play vim golf outside of hx if the weather is nice ;)) etc. Having to manually manage undo points within long editing sessions doesn't follow from that.
But this is a bad suggestion precisely for the anti-feature reason you described above — that just floods your undo history on a per char basis. I don't need that kind of granularity :) Then you could also combine it with adding undo breaks on punctuation:
And on spaces like you suggest, then I think that should fully resolve this feature request
Is this an existing command or a planned one? Tried to use it, but it errored out on launch, would also be great for some other things I wanted to do P.S.
Just out of curiosity, how would this command differ from a |
For anyone coming here from google, a
Maybe also to |
I think @archseer made his stance clear here and I agree.
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Currently
undo
seems to undo all the changes per an "Insert session"So, this
insert_mode
type a lot of text
normal_mode
undo
deletes "type a lot of text"
This is too coarse, especially when typing a lot of text in one go.
Is there a way to increase the undo granularity to delete, say, by typed word? So it would behave more like this:
1st
undo
deletes "text"2nd
undo
deletes "of "3rd
undo
deletes "lot "...
(can be a separate command or an additional argument like
:undo 1w
or something)The text was updated successfully, but these errors were encountered: