[vim/vim] Lua interface broken after Lua 5.5 upgrade (Issue #19639)

8 views
Skip to first unread message

Binbin Qian

unread,
Mar 11, 2026, 4:29:28 PM (21 hours ago) Mar 11
to vim/vim, Subscribed
qianbinbin created an issue (vim/vim#19639)

Steps to reproduce

Install vim 9.2.0100_1 with brew install vim, or build from source with Lua 5.5

Expected behaviour

Any plugin that uses Vim's Lua interface (e.g., vim-lsp, nvim) should work well, but it outputs attempt to call a nil value

Homebrew issue: Homebrew/homebrew-core#271311
Workaround: Homebrew/homebrew-core#271780

Version of Vim

9.2.0100

Environment

macOS 15.7.4
iTerm2 Build 3.6.8
xterm-256color
zsh 5.9

Logs and stack traces


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19639@github.com>

Christian Brabandt

unread,
Mar 11, 2026, 4:40:27 PM (20 hours ago) Mar 11
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19639)

I don't really know lua, but claude suggests this fix:

diff --git a/src/if_lua.c b/src/if_lua.c
index 364256161..7321af268 100644
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -2431,8 +2431,7 @@ luaV_pushversion(lua_State *L)
     "    -- Note: ignores trailing item without trailing `;`. Not using something\n"\
     "    -- simpler in order to preserve empty items (stand for default path).\n"\
     "    local orig = {}\n"\
-    "    for s in orig_str:gmatch('[^;]*;') do\n"\
-    "      s = s:sub(1, -2)  -- Strip trailing semicolon\n"\
+    "    for s in orig_str:gmatch('([^;]*);') do\n"\
     "      orig[#orig + 1] = s\n"\
     "    end\n"\
     "    if key == 'path' then\n"\


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19639/4042069387@github.com>

James McCoy

unread,
Mar 11, 2026, 5:10:54 PM (20 hours ago) Mar 11
to vim/vim, Subscribed
jamessan left a comment (vim/vim#19639)

Any plugin that uses Vim's Lua interface should work well

This is an apparently common misconception. Lua 5.x versions are explicitly not compatible with each other. The ABIs are different, the syntax of the language changes, etc.

Lua 5.1 / LuaJIT are the common base that most things work with. Adding support for other versions is an explicit choice which must be done every time a new version is released.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19639/4042231720@github.com>

Binbin Qian

unread,
Mar 11, 2026, 5:17:31 PM (20 hours ago) Mar 11
to vim/vim, Subscribed
qianbinbin left a comment (vim/vim#19639)

Thanks @jamessan , so it's best to roll back the lua dependency of brew vim to 5.4. Should I close the issue?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19639/4042264648@github.com>

Christian Brabandt

unread,
Mar 11, 2026, 5:26:02 PM (20 hours ago) Mar 11
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19639)

Don't close this issue, this is valid problem. But it would help if you could check if the suggested fix does - welll - fix it :)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19639/4042310664@github.com>

James McCoy

unread,
Mar 11, 2026, 5:28:02 PM (20 hours ago) Mar 11
to vim/vim, Subscribed
jamessan left a comment (vim/vim#19639)

so it's best to roll back the lua dependency of brew vim to 5.4

Yes. I'd even question why it's using 5.4 in the first place. Most Lua code is going to be compatible with Lua 5.1 / LuaJIT. IMO, that's the safest version to use by default, although having the ability to build with different versions is helpful if people specifically need a different version.

Should I close the issue?

That's up to the Vim maintainers. :) Being able to use Vim with Lua 5.5 probably isn't a bad idea.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19639/4042321498@github.com>

Binbin Qian

unread,
Mar 11, 2026, 6:11:37 PM (19 hours ago) Mar 11
to vim/vim, Subscribed
qianbinbin left a comment (vim/vim#19639)

Yes. I'd even question why it's using 5.4 in the first place.

I'm not a Homebrew developer, but it seems they prefer the latest stable version.

But it would help if you could check if the suggested fix does - welll - fix it :)

Sure, I've compiled a new one with the patch and it works for me, but I'm not sure if it works in all Lua cases...


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19639/4042567350@github.com>

Reply all
Reply to author
Forward
0 new messages