ref: c7b5ad4772e5ad2183d24f6ae9ffde85dfdc42dd
parent: edd9a39b5350d707c1e0ff5d171766175a182886
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Jun 17 11:57:30 EDT 2015
Fix up indent script.
--- a/support/vim/indent/myr.vim
+++ b/support/vim/indent/myr.vim
@@ -24,7 +24,7 @@
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 @@
\ '\<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 @@
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)