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

Plugin to visualise and navigate the undo tree #21

Open
AckslD opened this issue Jun 3, 2021 · 10 comments
Open

Plugin to visualise and navigate the undo tree #21

AckslD opened this issue Jun 3, 2021 · 10 comments
Labels
help wanted Extra attention is needed idea

Comments

@AckslD
Copy link

AckslD commented Jun 3, 2021

What?
A way to visualise and navigate the undo tree.

Why?
See above.

Potential existing implementations:
gundo.vim

Potential pitfalls:

@AckslD AckslD added help wanted Extra attention is needed idea labels Jun 3, 2021
@bew
Copy link

bew commented Jun 3, 2021

There is also vim-mundo (a fork of gundo) which I'm using.

NOTE: it requires python

@rodamaral
Copy link

There is also vim-mundo (a fork of gundo) which I'm using.

and which is kinda slow, a Lua plugin is very welcome in this department.

@talbergs
Copy link

talbergs commented Aug 3, 2021

Also, vim-mundo asks for python (which I do not use).

@Julian
Copy link

Julian commented Aug 13, 2021

undotree sets the bar here IMO (and is what I use).

@matu3ba
Copy link

matu3ba commented Aug 26, 2021

@Julian @AckslD Do you happen to know about speed of undotree ? I am skeptical, if lua is necessary for applying the undohistory, since the main functionality is written inside neovim core.

So the plugin would only need to make visualisation and usability.

@Julian
Copy link

Julian commented Aug 26, 2021

In my experience the speed of undotree is fine.

(And I agree with the skepticism, I'm not a fan of rewriting or creating new Lua plugins just to say they're in Lua, they should also be better than the existing best, if only by being feature equivalent but being more maintainable not being vimscript. My point was just to share what I think the best current example is here :)

@HrvojeFER
Copy link

It would be nice to have something like this as an extension to Telescope with a preview of changes.

@matu3ba
Copy link

matu3ba commented Jul 18, 2022

https://github.com/simnalamburt/vim-mundo has the awesome "search in undo history" feature, which I think is a must have of a lua rewrite (for perf reasons).

see also mbbill/undotree#48
https://github.com/mbbill/undotree/tree/search

Unfortunately telescope has no "save search result state" to dump and load last state of the search window, which I feel would be a must have to search + navigate the search history on tracking down changes in multiple branches (traverse along the branch + keep searching in this branch etc).

The other thing I am not sure about, is if the visualization in telescope of the tree during search is simple enough to adjust.

@debugloop
Copy link

https://github.com/debugloop/telescope-undo.nvim I've written something that checks some of these boxes, take a look :)

@bew
Copy link

bew commented Dec 23, 2022

After reading this post:
https://austinhenley.com/blog/yestercode.html
I like the simple UI, and I'm starting to want something like this: keep the current code, but get a preview (in a split / float) of the state of my file X minutes/changes ago. The undo-tree plugins I tried usually show a diff preview of each change as we navigate, not the actual file as it was.

And to extend this, I've been thinking about having a kind of preview like this for the current line of code, or the current function.. Where the undo-tree is filtered to only show the changes that actually changes that line, function..
We'd need special care for the UI of such a filtered undo-tree, to avoid confusion though.
And maybe prevent 'restore file to this change', unless we can also scope it to revert only the line, function,...?

I'm not sure how we could find all related change for a set of lines, to work for renamed functions/class/.., 'might' be possible by finding the change that did a rename, but it's not easy.
But I think it would already be great without rename tracking!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed idea
Projects
None yet
Development

No branches or pull requests

8 participants