rbong / vim-flog

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

flog#graph#vim#GetUsingBinLua: line 25: E909: Cannot index a special variable #94

Closed faisal-shah closed 1 year ago

faisal-shah commented 1 year ago

When running :Flog, full error message: Error detected while compiling function flog#cmd#Flog[19]..flog#floggraph#buf#Update[16]..flog#graph#vim#Get[10]..flog#graph#vim#GetUsingBinLua: line 25: E909: Cannot index a special variable flog#floggraph#buf#Update returning #-1

Recently upgraded to V2.

Installed luaJIT and dev per instructions. Set g:flog_lua_bin to the correct luajit path. Not getting any errors with missing LuaJIT or anything when running vim in verbose (vim -V20log).

I tried man, I really did :) . I tried to print the output of flog#shell#Run(cmd) by editing the flog/graph/vim.vim file - but I couldn't print to the message log with echo, echom, echoerr. I even tried :breakadd here to run it in the debugger. Couldn't grok debugging vim script.

Let me know what you need to track this down.

rbong commented 1 year ago

What do you get from vim --version? Looks like https://github.com/vim/vim/issues/11389

Any luck updating vim and trying again?

faisal-shah commented 1 year ago

Ok, built Vim from source, and now I have up to patchset 1249.

Now getting a new error: Error detected while compiling function flog#cmd#Flog[19]..flog#floggraph#buf#Update[16]..flog#graph#vim#Get[8]..flog#graph#vim#GetUsingInternalLua: line 31: E117: Unknown function: luaeval flog#floggraph#buf#Update returning #-1

I tried the following: :echo flog#graph#vim#ShouldUseInternal() 0 :echo has('lua') 0

For some reason flog#graph#vim#GetUsingInternalLua is getting run instead of flog#graph#vim#GetUsingBinLua. For giggles, I changed the call from GetUsingInternalLua to GetUsingBinLua and it all worked!

PS. It's much faster, thanks!

rbong commented 1 year ago

E117: Unknown function: luaeval

The thing to note seems to be this:

Error detected while compiling function

Looks like the error is on compilation, not necessary execution of the function.

I've tried to fix this by splitting the internal and bin Lua functions into separate files - vim shouldn't try to compile them until they're loaded.

However I was not able to recreate. Please let me know if you still have the problem after resetting your changes and updating.

faisal-shah commented 1 year ago

That worked, Thanks

igorsol commented 1 year ago

@faisal-shah can you please explain what you did to fix this issue?

faisal-shah commented 1 year ago

@faisal-shah can you please explain what you did to fix this issue?

Installed the latest version of Vim (built with lua feature enabled) and got the latest changes from this repo (@rbong made some changes in the course of this issue).