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

[feature] support for history tree (undo redo tree) #459

Open
trusktr opened this issue Dec 27, 2020 · 4 comments
Open

[feature] support for history tree (undo redo tree) #459

trusktr opened this issue Dec 27, 2020 · 4 comments
Labels
category: integration bindings, commands, etc enhancement New feature or request manager: buffer

Comments

@trusktr
Copy link
Contributor

trusktr commented Dec 27, 2020

In plain vim, I use plugins like mbbill/undotree to see and navigate the history tree.

It would be neat to have something like this inside VS Code. So useful!

@asvetliakov asvetliakov added the enhancement New feature or request label Jan 3, 2021
This was referenced Jan 3, 2021
@timoxley
Copy link

timoxley commented Jan 4, 2021

So perhaps this could be made to work by editing the plugin(s) to call vscode split/window commands instead of the vim commands? Is that likely to be straighforward?

@asvetliakov
Copy link
Member

The extension can work with a buffers originated from neovim, but will skip any initially empty ones. That's why :help works (contains text) but PlugStatus doesn't (a content does appear slightly later here).

So immediate workaround is to try to fill something when gundo/undotree buffer is being created, something like this can possibly work:

autocmd BufAdd [gundo-buffer-name/wildcard] <code to insert something (any text) into the buffer>

@timoxley
Copy link

timoxley commented Jan 4, 2021

@asvetliakov 👍 ok that seems to sort of work:

autocmd BufAdd __Gundo__ call appendbufline("__Gundo__", "$", " ")

image

However, yeah it takes over the whole editor, and doesn't seem to actually function to edit history because it can't find the buffer to change:

image

Maybe the best solution would actually be a new vscode plugin that connects vim undo branches with the new VSCode Timeline view.

@asvetliakov
Copy link
Member

asvetliakov commented Jan 4, 2021

That's probably because that buffer is being disconnected and inserted into new window, so original binding to parent windows is lost and breaks the plugin

Maybe the best solution would actually be a new vscode plugin that connects vim undo branches with the new VSCode Timeline view.

VScode doesn't have api for that, also i don't think vscode timeline supports undo branches (actually it has some). You can try though to use vscode undo stack, just map u/<C-r> to vscode's undo/redo

I have some plans to improve such buffers support, but it would take some time.

@theol0403 theol0403 added the category: integration bindings, commands, etc label Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: integration bindings, commands, etc enhancement New feature or request manager: buffer
Projects
None yet
Development

No branches or pull requests

5 participants