commit 29a47b39ccd0317e815632439966f0f1343d96cf
parent d40481322a7959d36804cb4f438d8756fb8171a0
Author: phanium <91544758+phanen@users.noreply.github.com>
Date: Tue, 18 Mar 2025 08:59:48 +0800
fix(runtime): E15: Invalid expression in lua file when `gf`
Problem:
after https://github.com/neovim/neovim/pull/32719, `gf` error in lua:
```
E15: Invalid expression: "v:lua.require"vim._ftplugin.lua".includeexpr()"
E447: Can't find file "vim._ftplugin.lua" in path
```
Solution:
* use single quote (no idea why there's two pair double quote in
expression).
* add missing `v:fname`.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/runtime/ftplugin/lua.lua b/runtime/ftplugin/lua.lua
@@ -1,7 +1,7 @@
-- use treesitter over syntax
vim.treesitter.start()
-vim.bo.includeexpr = 'v:lua.require"vim._ftplugin.lua".includeexpr()'
+vim.bo.includeexpr = [[v:lua.require'vim._ftplugin.lua'.includeexpr(v:fname)]]
vim.bo.omnifunc = 'v:lua.vim.lua_omnifunc'
vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'