rbong / vim-flog

A blazingly fast, stunningly beautiful, exceptionally powerful git branch viewer for Vim/Neovim.
750 stars 22 forks source link

Unknown function: flog#graph#vim#Get #103

Closed mbeko closed 1 year ago

mbeko commented 1 year ago

Today, I updated my Vim plugins after several months, including Fugitive and Flog.

When opening Flog, two errors appeared. I looked around and noticed that Flog received the major version 2 update, so I followed the migration instructions by installing LuaJIT 2.1.

The errors persisted, so I tried to use the v2.0.0 tag instead of the main branch. Now I only get the first error, so I'm reporting that one for the moment:

Error detected while processing function flog#cmd#Flog[19]..flog#floggraph#buf#Update:
line   16:
E117: Unknown function: flog#graph#vim#Get

When I use the v1 branch, Flog works.

I use Ubuntu 22.04.2 LTS and mostly install software from the package manager, so I'm still on Vim 8 but the migration guide says that version is supported.

Fugitive is on commit 5f0d280 and Vim is

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 18 2023 11:40:57)
Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919
...
+lua
...
rbong commented 1 year ago

I tried to use the v2.0.0 tag instead of the main branch

v2.0.0 is old at this point. There have been fixes including fixes for older versions of Vim by now. master has been very stable since the end of January and it's probably time for another tagged version. I wouldn't recommend using v2.0.0 as a solution.

Try the master branch again and send the other error please.

E117: Unknown function: flog#graph#vim#Get

The function exists and is defined in the correct file. What's probably happening is that there is another error and the file can't load. If you're not restarting Vim when switching branches, Vim could be hiding the error from you and you're still getting the same error. Or it could just be going by too quickly to notice or be obscured by other errors.

Check :messages for any other errors and send them please after switching back to the master branch.

Vi IMproved 8.2 (2019 Dec 12, compiled Apr 18 2023 11:40:57) Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919

Version 8 is supported, but the exact minor and patch version is fuzzy. There has been a lot of work on vimscript9 in v8. v8.0 won't work, the latest minor versions will.

v8.2.4212 is used in tests, you have v8.2.3995 with additional patches (so probably just bugfixes).

I don't like telling people to compile from scratch, but unfortunately that might be the solution here.

rbong commented 1 year ago

I was able to run tests with v8.2.3995 successfully (though it still might not work in the real world).

mbeko commented 1 year ago

Thanks for the quick reaction and the information.

Here are the errors that are displayed directly upon calling :Flog on the main branch:

Error detected while processing function flog#cmd#Flog[19]..flog#floggraph#buf#Update[21]..flog#graph#vim#Get[14]..function flog#cmd#Flog[19]..flog#floggraph#buf#Update[21]..flog#graph#vim#Get:
line   10:
E117: Unknown function: flog#graph#vim#bin#Get
Error detected while processing function flog#cmd#Flog[19]..flog#floggraph#buf#Update:
line   21:
E171: Missing :endif

This is also exactly what I get when calling :messages, nothing more. I always reopen Vim after doing plugin updates to avoid issues, so it must be something unrelated to the current session.

If there were issues with my Lua installation, would I get an error message pointing to that? I had also tried to explicitly set the path to luajit according to the migration guide but this didn't change anything.

Otherwise, if you weren't able to reproduce it in your test, I'm fine with closing the issue. Either I'll get to try and compile Vim or I'll wait for the next system upgrade where I expect Vim being updated to version 9. Staying on v1 for the time being is fine for me – thanks for having provided that possibilty.

rbong commented 1 year ago

E171: Missing :endif

This should be fixed now. Apparently older versions of Vim don't like using end to end if statements instead of endif.

If there were issues with my Lua installation, would I get an error message pointing to that?

No, it's likely a vim9script bug with that particular version of Vim. As I recall now, there were some vim9script autoload export/import errors that would cause this exact issue that wouldn't be caught in tests, so now that we've eliminated other possibilities, it's likely that.

I've hopefully fixed this import/export issue, though I can't guarantee you won't get other vim9script bugs on your current version of vim.

mbeko commented 1 year ago

Amazing, that fixed it! You're a wizard, thanks a lot! :slightly_smiling_face:

One particularly large and old project has previously taken some seconds to load the history, now it loads basically instantaneously. Great job :muscle:

rbong commented 1 year ago

No problem, thanks for reporting