@@ -3,7 +3,7 @@
33" Based on haskell indentation by motemen <motemen@gmail.com>
44"
55" author: raichoo (raichoo@googlemail.com)
6−" date: Oct 19 2012
6+" date: Oct 31 2012
77"
88" Modify g:idris_indent_if and g:idris_indent_case to
99" change indentation for `if'(default 3) and `case'(default 5).
@@ -49,7 +49,7 @@ if !exists('g:idris_indent_do')
4949endif
5050
5151setlocal indentexpr=GetIdrisIndent()
52−setlocal indentkeys=!^F,o,O
52+setlocal indentkeys=!^F,o,O,}
5353
5454function! GetIdrisIndent()
5555 let prevline = getline(v:lnum - 1)
@@ -63,7 +63,7 @@ function! GetIdrisIndent()
6363 endif
6464 endif
6565
66− if prevline =~ '[{([]\s*$'
66+ if prevline =~ '[{([][^})\]]\+$'
6767 return match(prevline, '[{([]')
6868 endif
6969
@@ -83,7 +83,7 @@ function! GetIdrisIndent()
8383 endif
8484 endif
8585
86− if prevline =~ '\(where\|do\|=\)\s*$'
86+ if prevline =~ '\(where\|do\|=\|[{([]\)\s*$'
8787 return match(prevline, '\S') + &shiftwidth
8888 endif
8989
@@ -115,5 +115,15 @@ function! GetIdrisIndent()
115115 return match(prevline, '\(using\|parameters\)') + &shiftwidth
116116 endif
117117
118+ if prevline =~ '^\s*mutual\s*$'
119+ return match(prevline, 'mutual') + &shiftwidth
120+ endif
121+
122+ let line = getline(v:lnum)
123+
124+ if (line =~ '^\s*}\s*' && prevline !~ '^\s*;')
125+ return match(prevline, '\S') - &shiftwidth
126+ endif
127+
118128 return match(prevline, '\S')
119129endfunction