commit 8fb1a8d4cac35ba1fadbb47dbe2beb3faf621260
parent 54468c1c3c2e412e5e0d714101cdfbb44ae4600a
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue, 10 Feb 2026 06:42:30 +0800
vim-patch:e92998e: runtime(nginx): highlight Lua in set_by_lua_block in syntax script
The set_by_lua_block directive of the Lua module takes an additional
variable as an argument which currently breaks the detection of inline
Lua blocks. For example:
set_by_lua_block $myvar {
return tonumber(ngx.var.myothervar)-1
}
closes: vim/vim#19362
https://github.com/vim/vim/commit/e92998ea4dfbd6de3e028e74ef8042cebd7e0f4c
Co-authored-by: Josef Schönberger <josef.schoenberger@tum.de>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/runtime/syntax/nginx.vim b/runtime/syntax/nginx.vim
@@ -2302,7 +2302,7 @@ let b:current_syntax = "nginx"
" Enable nested LUA syntax highlighting
unlet b:current_syntax
syn include @LUA syntax/lua.vim
-syn region ngxLua start=+^\s*\w\+_by_lua_block\s*{+ end=+}+me=s-1 contains=ngxBlock,@LUA
+syn region ngxLua start=+^\s*\w\+_by_lua_block\s*\(\$\w\+\s*\)\?{+ end=+}+me=s-1 contains=ngxBlock,@LUA
let b:current_syntax = "nginx"