@@ -3,7 +3,7 @@
3" Based on haskell indentation by motemen <motemen@gmail.com>
3" Based on haskell indentation by motemen <motemen@gmail.com>
5" author: raichoo (raichoo@googlemail.com)
5" author: raichoo (raichoo@googlemail.com)
6−" date: Oct 31 2012
6+" date: Nov 2 2012
8" Modify g:idris_indent_if and g:idris_indent_case to
8" Modify g:idris_indent_if and g:idris_indent_case to
9" change indentation for `if'(default 3) and `case'(default 5).
9" change indentation for `if'(default 3) and `case'(default 5).
@@ -67,7 +67,7 @@ function! GetIdrisIndent()
67 return match(prevline, '[{([]')
67 return match(prevline, '[{([]')
70− if prevline =~ 'let\s\+.\+in\s*$'
70+ if prevline =~ '\<let\>\s\+.\+\<in\>\s*$'
71 return match(prevline, 'let') + g:idris_indent_let
71 return match(prevline, 'let') + g:idris_indent_let
@@ -83,40 +83,40 @@ function! GetIdrisIndent()
86− if prevline =~ '\(where\|do\|=\|[{([]\)\s*$'
86+ if prevline =~ '\(\<where\>\|\<do\>\|=\|[{([]\)\s*$'
87 return match(prevline, '\S') + &shiftwidth
87 return match(prevline, '\S') + &shiftwidth
90− if prevline =~ 'where\s\+\S\+.*$'
90+ if prevline =~ '\<where\>\s\+\S\+.*$'
91− return match(prevline, 'where') + g:idris_indent_where
91+ return match(prevline, '\<where\>') + g:idris_indent_where
94− if prevline =~ 'do\s\+\S\+.*$'
94+ if prevline =~ '\<do\>\s\+\S\+.*$'
95− return match(prevline, 'do') + g:idris_indent_do
95+ return match(prevline, '\<do\>') + g:idris_indent_do
98− if prevline =~ '^\s*\(co\)\?data\s\+[^=]\+\s\+=\s\+\S\+.*$'
98+ if prevline =~ '^\s*\<\(co\)\?data\>\s\+[^=]\+\s\+=\s\+\S\+.*$'
99 return match(prevline, '=')
99 return match(prevline, '=')
102− if prevline =~ 'with\s\+([^)]*)\s*$'
102+ if prevline =~ '\<with\>\s\+([^)]*)\s*$'
103 return match(prevline, '\S') + &shiftwidth
103 return match(prevline, '\S') + &shiftwidth
106− if prevline =~ 'case\s\+.\+of\s*$'
106+ if prevline =~ '\<case\>\s\+.\+\<of\>\s*$'
107 return match(prevline, 'case') + g:idris_indent_case
107 return match(prevline, 'case') + g:idris_indent_case
110− if prevline =~ '^\s*\(namespace\|\(co\)\?data\)\s\+\S\+\s*$'
110+ if prevline =~ '^\s*\(\<namespace\>\|\<\(co\)\?data\>\)\s\+\S\+\s*$'
111− return match(prevline, '\(namespace\|\(co\)\?data\)') + &shiftwidth
111+ return match(prevline, '\(\<namespace\>\|\<\(co\)\?data\>\)') + &shiftwidth
114− if prevline =~ '^\s*\(using\|parameters\)\s*([^(]*)\s*$'
114+ if prevline =~ '^\s*\(\<using\>\|\<parameters\>\)\s*([^(]*)\s*$'
115− return match(prevline, '\(using\|parameters\)') + &shiftwidth
115+ return match(prevline, '\(\<using\>\|\<parameters\>\)') + &shiftwidth
118− if prevline =~ '^\s*mutual\s*$'
118+ if prevline =~ '^\s*\<mutual\>\s*$'
119− return match(prevline, 'mutual') + &shiftwidth
119+ return match(prevline, '\<mutual\>') + &shiftwidth
122 let line = getline(v:lnum)
122 let line = getline(v:lnum)