Update runtime files.

This commit is contained in:
Bram Moolenaar
2015-08-11 20:34:49 +02:00
parent 25c2f6783a
commit fc39ecf8de
16 changed files with 171 additions and 195 deletions

View File

@ -1,10 +1,11 @@
" Vim indent file
" Language: Shell Script
" Maintainer: Currently unmaintained. If you want to take it, please
" email Bram
" Language: Shell Script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Peter Aronoff <telemachus@arpinum.org>
" Original Author: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2014-08-22
" Original Author: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2015-07-28
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-sh-indent
if exists("b:did_indent")
finish
@ -12,7 +13,7 @@ endif
let b:did_indent = 1
setlocal indentexpr=GetShIndent()
setlocal indentkeys+=0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,),0=;;,0=;&
setlocal indentkeys+=0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,0=end,),0=;;,0=;&
setlocal indentkeys+=0=fin,0=fil,0=fip,0=fir,0=fix
setlocal indentkeys-=:,0#
setlocal nosmartindent
@ -56,8 +57,8 @@ function! GetShIndent()
let ind = indent(lnum)
let line = getline(lnum)
if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\)\>'
if line !~ '\<\%(fi\|esac\|done\)\>\s*\%(#.*\)\=$'
if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>'
if line !~ '\<\%(fi\|esac\|done\|end\)\>\s*\%(#.*\)\=$'
let ind += s:indent_value('default')
endif
elseif s:is_case_label(line, pnum)
@ -78,7 +79,7 @@ function! GetShIndent()
let pine = line
let line = getline(v:lnum)
if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\)\>' || line =~ '^\s*}'
if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\|end\)\>' || line =~ '^\s*}'
let ind -= s:indent_value('default')
elseif line =~ '^\s*esac\>' && s:is_case_empty(getline(v:lnum - 1))
let ind -= s:indent_value('default')