@@ -3,7 +3,7 @@
33" Based on haskell indentation by motemen <motemen@gmail.com>
44"
55" author: raichoo (raichoo@googlemail.com)
6−" date: Nov 2 2012
6+" date: Mar 19 2013
77"
88" Modify g:idris_indent_if and g:idris_indent_case to
99" change indentation for `if'(default 3) and `case'(default 5).
@@ -36,6 +36,12 @@ if !exists('g:idris_indent_let')
3636 let g:idris_indent_let = 4
3737endif
3838
39+if !exists('g:idris_indent_rewrite')
40+ " rewrite prf in expr
41+ " >>>>x
42+ let g:idris_indent_rewrite = 8
43+endif
44+
3945if !exists('g:idris_indent_where')
4046 " where f : Nat -> Nat
4147 " >>>>>>f x = x
@@ -71,6 +77,10 @@ function! GetIdrisIndent()
7177 return match(prevline, 'let') + g:idris_indent_let
7278 endif
7379
80+ if prevline =~ '\<rewrite\>\s\+.\+\<in\>\s*$'
81+ return match(prevline, 'rewrite') + g:idris_indent_rewrite
82+ endif
83+
7484 if prevline !~ '\<else\>'
7585 let s = match(prevline, '\<if\>.*\&.*\zs\<then\>')
7686 if s > 0