diff options
author | Ori Bernstein <ori@eigenstate.org> | 2015-06-17 15:57:30 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2015-06-17 15:57:30 -0700 |
commit | c7b5ad4772e5ad2183d24f6ae9ffde85dfdc42dd (patch) | |
tree | 9ced8ce6b00b650d15f31382151fc29971066c12 /support/vim | |
parent | edd9a39b5350d707c1e0ff5d171766175a182886 (diff) | |
download | mc-c7b5ad4772e5ad2183d24f6ae9ffde85dfdc42dd.tar.gz |
Fix up indent script.
Diffstat (limited to 'support/vim')
-rw-r--r-- | support/vim/indent/myr.vim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/support/vim/indent/myr.vim b/support/vim/indent/myr.vim index d53111c..2dbadfe 100644 --- a/support/vim/indent/myr.vim +++ b/support/vim/indent/myr.vim @@ -24,7 +24,7 @@ function! s:CountMatches(line, lnum, pats) while idx >= 0 let idx = match(a:line, p, idx) if idx >= 0 - let ic = Quoted(a:lnum, idx) + let ic = Quoted(a:lnum, idx+1) if !ic let matches = matches + 1 endif @@ -67,8 +67,8 @@ function! GetMyrIndent(ln) \ '\<struct\>', '\<union\>', \ '{', '\[', '(', '^\s*|', '=\s*$'] let outpat = ['}', ']', '(', ';;'] - let outalone = ['\<else\>', '\<elif\>.*', - \ '}.*', '].*', ').*', ';;', '|.*'] + let outalone = ['\<else\>', '\<elif\>.*', ';;', '|.*', + \ '].*', ').*', '}.*'] let width = &tabstop let n_in = s:CountMatches(prevln, ln - i, inpat) @@ -84,7 +84,7 @@ function! GetMyrIndent(ln) endif " avoid double counting outdents that are also outalone - if n_out > 0 && s:LineMatch(prevln, outalone) != 0 + if s:CountMatches(curln, ln, inpat) == 0 && s:LineMatch(prevln, outalone) != 0 let n_out = n_out - 1 endif let n_out = n_out + s:LineMatch(curln, outalone) |