summaryrefslogtreecommitdiffstats
path: root/runtime/indent/lua.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:05:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:05:19 +0000
commita4e9136f68a40b1cb0eb6df5a5f06603224a87f4 (patch)
treeba32e0d0069ad6adfd6b32d05161a03eea5e4c7c /runtime/indent/lua.vim
parentReleasing progress-linux version 2:9.1.0496-1~progress7.99u1. (diff)
downloadvim-a4e9136f68a40b1cb0eb6df5a5f06603224a87f4.tar.xz
vim-a4e9136f68a40b1cb0eb6df5a5f06603224a87f4.zip
Merging upstream version 2:9.1.0698.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/indent/lua.vim')
-rw-r--r--runtime/indent/lua.vim9
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/indent/lua.vim b/runtime/indent/lua.vim
index 35b08d4..ce6cfe1 100644
--- a/runtime/indent/lua.vim
+++ b/runtime/indent/lua.vim
@@ -4,6 +4,7 @@
" First Author: Max Ischenko <mfi 'at' ukr.net>
" Last Change: 2017 Jun 13
" 2022 Sep 07: b:undo_indent added by Doug Kearns
+" 2024 Jul 27: by Vim project: match '(', ')' in function GetLuaIndentIntern()
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -46,12 +47,12 @@ function! GetLuaIndentIntern()
endif
" Add a 'shiftwidth' after lines that start a block:
- " 'function', 'if', 'for', 'while', 'repeat', 'else', 'elseif', '{'
+ " 'function', 'if', 'for', 'while', 'repeat', 'else', 'elseif', '{', '('
let ind = indent(prevlnum)
let prevline = getline(prevlnum)
let midx = match(prevline, '^\s*\%(if\>\|for\>\|while\>\|repeat\>\|else\>\|elseif\>\|do\>\|then\>\)')
if midx == -1
- let midx = match(prevline, '{\s*\%(--\%([^[].*\)\?\)\?$')
+ let midx = match(prevline, '\%({\|(\)\s*\%(--\%([^[].*\)\?\)\?$')
if midx == -1
let midx = match(prevline, '\<function\>\s*\%(\k\|[.:]\)\{-}\s*(')
endif
@@ -65,9 +66,9 @@ function! GetLuaIndentIntern()
endif
endif
- " Subtract a 'shiftwidth' on end, else, elseif, until and '}'
+ " Subtract a 'shiftwidth' on end, else, elseif, until, '}' and ')'
" This is the part that requires 'indentkeys'.
- let midx = match(getline(v:lnum), '^\s*\%(end\>\|else\>\|elseif\>\|until\>\|}\)')
+ let midx = match(getline(v:lnum), '^\s*\%(end\>\|else\>\|elseif\>\|until\>\|}\|)\)')
if midx != -1 && synIDattr(synID(v:lnum, midx + 1, 1), "name") != "luaComment"
let ind = ind - shiftwidth()
endif