comparison runtime/indent/lua.vim @ 7557:502ca0a62fd8

commit https://github.com/vim/vim/commit/acb4f221c715a333f4c49a2235a8006c6ac6e4d5 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 10 15:59:26 2016 +0100 Updated runtime files.
author Christian Brabandt <cb@256bit.org>
date Sun, 10 Jan 2016 16:00:06 +0100
parents c5d53d4c3e2e
children 63b0b7b79b25
comparison
equal deleted inserted replaced
7556:823c4567b8a2 7557:502ca0a62fd8
1 " Vim indent file 1 " Vim indent file
2 " Language: Lua script 2 " Language: Lua script
3 " Maintainer: Marcus Aurelius Farias <marcus.cf 'at' bol.com.br> 3 " Maintainer: Marcus Aurelius Farias <marcus.cf 'at' bol.com.br>
4 " First Author: Max Ischenko <mfi 'at' ukr.net> 4 " First Author: Max Ischenko <mfi 'at' ukr.net>
5 " Last Change: 2014 Nov 12 5 " Last Change: 2016 Jan 10
6 6
7 " Only load this indent file when no other was loaded. 7 " Only load this indent file when no other was loaded.
8 if exists("b:did_indent") 8 if exists("b:did_indent")
9 finish 9 finish
10 endif 10 endif
50 if synIDattr(synID(prevlnum, midx + 1, 1), "name") != "luaComment" && prevline !~ '\<end\>\|\<until\>' 50 if synIDattr(synID(prevlnum, midx + 1, 1), "name") != "luaComment" && prevline !~ '\<end\>\|\<until\>'
51 let ind = ind + &shiftwidth 51 let ind = ind + &shiftwidth
52 endif 52 endif
53 endif 53 endif
54 54
55 " Subtract a 'shiftwidth' on end, else (and elseif), until and '}' 55 " Subtract a 'shiftwidth' on end, else, elseif, until and '}'
56 " This is the part that requires 'indentkeys'. 56 " This is the part that requires 'indentkeys'.
57 let midx = match(getline(v:lnum), '^\s*\%(end\>\|else\>\|until\>\|}\)') 57 let midx = match(getline(v:lnum), '^\s*\%(end\>\|else\>\|elseif\>\|until\>\|}\)')
58 if midx != -1 && synIDattr(synID(v:lnum, midx + 1, 1), "name") != "luaComment" 58 if midx != -1 && synIDattr(synID(v:lnum, midx + 1, 1), "name") != "luaComment"
59 let ind = ind - &shiftwidth 59 let ind = ind - &shiftwidth
60 endif 60 endif
61 61
62 return ind 62 return ind