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

:UndotreeToggle causes Undefined variable: t:diffpanel #159

Open
franciscopower opened this issue Jul 6, 2023 · 12 comments
Open

:UndotreeToggle causes Undefined variable: t:diffpanel #159

franciscopower opened this issue Jul 6, 2023 · 12 comments

Comments

@franciscopower
Copy link

Hi,
When running :UndotreeToggle I get the following error:

Error detected while processing function undotree#UndotreeToggle[17]..function undotree#UndotreeToggle[11]..25:
line    7:
E121: Undefined variable: t:diffpanel

By pressing "ENTER", the side panel toggles as expected, but I always get the error.
For context, I have a fresh nvim install, with almost no remaps and only the following plugins: telescope, vim-nightfly-colors, nvim-treesitter, vim-fugitive. I'm following this tutorial

@franciscopower franciscopower changed the title :UndotreeToggle causes Úndefined variable: t:diffpanel :UndotreeToggle causes Undefined variable: t:diffpanel Jul 6, 2023
@mbbill
Copy link
Owner

mbbill commented Jul 6, 2023

undotree.zip
Can yo try this version to see if the error is fixed? (put it under autoload folder)

@franciscopower
Copy link
Author

That fixed it, thanks!

@mbbill
Copy link
Owner

mbbill commented Jul 7, 2023

I just updated master branch with this patch, can you help verify it?

@franciscopower
Copy link
Author

franciscopower commented Jul 7, 2023

I'm testing it on another machine with the same config, but it's not working, even when I use the autoload file:

E5108: Error executing lua: function undotree#UndotreeToggle[11]..<SNR>55_new[2]..41, line 6: Vim(echoerr):"diff" is not executable.
stack traceback:
        [C]: at 0x7ff75b0a8640

The difference between machines is that I don't have Vim installed in this one, only NeoVim.

@mbbill
Copy link
Owner

mbbill commented Jul 7, 2023

looks like nvim displays error message in a not quite friendly way. "Vim(echoerr):"diff" is not executable." is the actual error message. You might need to install a diff tool on your system.

@franciscopower
Copy link
Author

Ok, thank you for your help I'll see what I can do. I just find it strange because both Powershell diff and nvim -d work...

@thubtenrigzin
Copy link

I've tried to init the plugin with g:undotree_DiffCommand = "git diff" or in lua vim.g.undotree_DiffCommand = "git diff" but it seems to not work as it still display the same error ("diff is not an executable").
How to set undotree plugin up with "git diff" tool or other than "diff"?

@Huddinii
Copy link

Just had the same Issue. I fixed it for me by installing vim and setting an environmental variable to the folder in which the diff.exe is installed.
Im using Windows if that has anythig to do with it.

@thearturca
Copy link

Just had the same Issue. I fixed it for me by installing vim and setting an environmental variable to the folder in which the diff.exe is installed. Im using Windows if that has anythig to do with it.

Have same issue on Windows. Can you explain which env you set?

@Huddinii
Copy link

Have same issue on Windows. Can you explain which env you set?

I set the System Vaiable "Path" to the folder that held the diff.exe.
In my case "C:\Program Files (x86)\Vim\vim90"

@thearturca
Copy link

Have same issue on Windows. Can you explain which env you set?

I set the System Vaiable "Path" to the folder that held the diff.exe. In my case "C:\Program Files (x86)\Vim\vim90"

Thank you.
I copied git-diff.exe from C:\Program Files\Git\mingw64\libexec\git-core and rename it to diff.exe. Then set Path to folder that held my brand new diff.exe from git and it solved the problem.

@GitMurf
Copy link

GitMurf commented Dec 27, 2023

Thanks a lot @thearturca and @Huddinii i also solved the undo tree toggle diff executable missing error by adding vim path to env variables.

But now when I try to view any diffs of the undo tree, the diff panel doesn’t work. Have you gotten the diff panel to also work?

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

6 participants