-
Notifications
You must be signed in to change notification settings - Fork 23
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 truncate-at-node for timestamp-based undo-list truncation #111
base: master
Are you sure you want to change the base?
Conversation
@jdtsmith Thank you, will test this tomorrow. :) |
Note that I like the fact If this moves in the direction of manipulating undo history, it could even be a separate package, functionality could include:
|
This would never be automatic, and you don't need to invoke the command of course. Interactively it prompts you both to select the date prior to which to truncate history, and a confirming Permanently remove all undo information prior to XXX? to which you have to respond "yes". So it's decidedly "opt-in". Note that vundo does alter history as part of its normal operation, trimming "unnecessary tails" of the list, which accumulate rapidly due to the way it navigates history. This is mostly but not entirely lossless; see #66. One issue driving this is for users of |
If the base of the list has a timestamp, truncating there will not remove anything. Is that what you are seeing? |
In the first video I choose the option with the earlier timestamp and nothing happens, I choose a more recent timestamp it it truncates. Is this a possible scenario? |
Yep that's what I meant. I pushed a small change to filter out nodes the truncation to which won't actually remove anything. See if that fixes it for you. I also provide a message indicating how many records were removed. And I changed the time format mentioned in the yes/no prompt. Update: I also added some record statistics to the completing-read prompt so you can see how much you will be removing. |
Use a simple ISO-formatted timestamp as key, and an annotation function for additional information (records, percentage).
Includes new key binding
K
to select a (saved) node by date, and truncate the undo-list prior to that node. Works well in limited testing. We could also add a "truncate to this node" binding if we wanted, which would work in all buffers.After refreshing, this also resets
vundo--roll-back-to-this
, which I might argue should be performed invundo--refresh-buffer
(since the nodes will have changed from entry). What do you think @casouri?