ref: 207d86eced0726bf8ce0eaeb6b6e06a40e47a2d9
parent: b08f20e577c31f439f4beb525125c6823b27c606
author: Ori Bernstein <ori@eigenstate.org>
date: Sat May 2 17:20:27 EDT 2015
Handle [] indents better.
--- a/support/vim/indent/myr.vim
+++ b/support/vim/indent/myr.vim
@@ -68,9 +68,9 @@
let inpat = ['\<if\>', '\<elif\>', '\<else\>',
\ '\<while\>','\<for\>', '\<match\>',
\ '\<struct\>', '\<union\>',
- \ '{', '^\s*|', '=\s*$']
- let outpat = ['}', ';;']
- let outalone = ['\<else\>', '\<elif\>.*', '}', ';;', '|.*']
+ \ '{', '\[', '^\s*|', '=\s*$']
+ let outpat = ['}', '\]', ';;']
+ let outalone = ['\<else\>', '\<elif\>.*', '}', '].*', ';;', '|.*']
let width = &tabstop
let n_in = s:CountMatches(prevln, ln - i, inpat)
@@ -85,7 +85,7 @@
return ind
endfunction
-setlocal indentkeys+=,;\|,=elif
+setlocal indentkeys+=,;\|],=elif
setlocal indentexpr=GetMyrIndent(v:lnum)
let b:did_indent = 1