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

set undotree to populate tree only on file written event (for example with :w) #163

Open
danielreis1 opened this issue Aug 30, 2023 · 3 comments

Comments

@danielreis1
Copy link

danielreis1 commented Aug 30, 2023

the problem is the undotree gets overpopulated, is it possible to populate the tree only when writting the file and not always when leave insert mode, (with always I mean: on what I think is populating the tree on InsertLeave event)

@mbbill
Copy link
Owner

mbbill commented Aug 30, 2023

what do you mean "overpopulated"? in vim undo nodes are created very often, usually when leaving the insert mode rather than writing to the disk.

@danielreis1
Copy link
Author

danielreis1 commented Aug 30, 2023

exactly they are created very ofter, I would like to be able to change how ofter they are created, by changing the event at which they are created for example, instead of the event InsertLeave, another event in the list 'h: events', is this possible?
WIth overpopulated I meant they are created too often, but then again, it's a matter of personal taste, so I guess it could be configurable(based on an event), but I am not sure how to do it here, or if it even is possible.
In my case, I would like to create the node when writting the buffer to disk.

@mbbill
Copy link
Owner

mbbill commented Aug 30, 2023

As far as I know, you're not able to change how often the undo nodes are created, nor can the plugin. The undo nodes are usually created when user exits insert mode, and this is why the plugin chose to hook on this event. It doesn't mean the plugin created the undo node. The plugin is essentially a "visualizer“ that displays the vim internal undo state in a fancy way.

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

2 participants