summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-06-28 14:26:16 -0700
committerOri Bernstein <ori@eigenstate.org>2015-06-28 14:26:16 -0700
commitb05bd318302a3b5043a56479d20261d81bc27012 (patch)
treee6a6532e0fd6255321fd6335464e8e57c28548cf /support
parentd17587d89ed49739392eb6d768d583c7f5955d2c (diff)
downloadmc-b05bd318302a3b5043a56479d20261d81bc27012.tar.gz
Implement '__init__' functions.
Diffstat (limited to 'support')
-rw-r--r--support/vim/indent/myr.vim11
1 files changed, 6 insertions, 5 deletions
diff --git a/support/vim/indent/myr.vim b/support/vim/indent/myr.vim
index d20010a..356f9ea 100644
--- a/support/vim/indent/myr.vim
+++ b/support/vim/indent/myr.vim
@@ -66,9 +66,9 @@ function! GetMyrIndent(ln)
\ '\<while\>','\<for\>', '\<match\>',
\ '\<struct\>', '\<union\>',
\ '{', '\[', '(', '^\s*|.*:', '=\s*$']
- let outpat = ['}', ']', ')', ';;']
+ let outpat = ['}', ']', ')']
let outalone = ['\<else\>', '\<elif\>.*', ';;', '|.*',
- \ '].*', ').*', '}.*']
+ \ '].*', '}.*']
let width = &tabstop
let n_in = s:CountMatches(prevln, ln - i, inpat)
@@ -84,9 +84,10 @@ function! GetMyrIndent(ln)
let n_out = n_out + 1
endif
- " we already outdented if we had an outalone
- if s:LineMatch(prevln, outalone) != 0
- let n_out = 0
+ " we already outdented if we had an outalone, but since all
+ " outpats are also outalones, we don't want to double count.
+ if s:LineMatch(prevln, outalone) != 0 && n_out > 0
+ let n_out = n_out - 1
endif
let n_out = n_out + s:LineMatch(curln, outalone)