diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2017-09-27 19:57:29 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2017-09-27 19:57:29 +0200 |
commit | 8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8 (patch) | |
tree | 125734ac66307a962eeda16283355dde0d0fbd2e /indent/lua.vim | |
parent | 9bfde7574aa89a91b80ed9c993fc000cfc11aae7 (diff) | |
download | vim-polyglot-8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8.tar.gz vim-polyglot-8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8.zip |
Update
Diffstat (limited to 'indent/lua.vim')
-rw-r--r-- | indent/lua.vim | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/indent/lua.vim b/indent/lua.vim index 901ac854..3c33c032 100644 --- a/indent/lua.vim +++ b/indent/lua.vim @@ -24,21 +24,21 @@ endif " Variables -----------------------------------------------{{{1 -let s:open_patt = '\%(\<\%(function\|if\|repeat\|do\)\>\|(\|{\)' -let s:middle_patt = '\<\%(else\|elseif\)\>' -let s:close_patt = '\%(\<\%(end\|until\)\>\|)\|}\)' +let s:open_patt = '\C\%(\<\%(function\|if\|repeat\|do\)\>\|(\|{\)' +let s:middle_patt = '\C\<\%(else\|elseif\)\>' +let s:close_patt = '\C\%(\<\%(end\|until\)\>\|)\|}\)' let s:anon_func_start = '\S\+\s*[({].*\<function\s*(.*)\s*$' let s:anon_func_end = '\<end\%(\s*[)}]\)\+' " Expression used to check whether we should skip a match with searchpair(). -let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ 'luaComment\\|luaString'" +let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~# 'luaComment\\|luaString'" " Auxiliary Functions -------------------------------------{{{1 function s:IsInCommentOrString(lnum, col) - return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ 'luaCommentLong\|luaStringLong' - \ && !(getline(a:lnum) =~ '^\s*\%(--\)\?\[=*\[') " opening tag is not considered 'in' + return synIDattr(synID(a:lnum, a:col, 1), 'name') =~# 'luaCommentLong\|luaStringLong' + \ && !(getline(a:lnum) =~# '^\s*\%(--\)\?\[=*\[') " opening tag is not considered 'in' endfunction " Find line above 'lnum' that isn't blank, in a comment or string. @@ -85,7 +85,7 @@ function GetLuaIndent() endif " special case: call(with, {anon = function() -- should indent only once - if num_pairs > 1 && contents_prev =~ s:anon_func_start + if num_pairs > 1 && contents_prev =~# s:anon_func_start let i = 1 endif @@ -98,7 +98,7 @@ function GetLuaIndent() endif " special case: end}) -- end of call with anon func should unindent once - if num_pairs > 1 && contents_cur =~ s:anon_func_end + if num_pairs > 1 && contents_cur =~# s:anon_func_end let i = -1 endif |