diff options
Diffstat (limited to 'indent/haskell.vim')
-rw-r--r-- | indent/haskell.vim | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/indent/haskell.vim b/indent/haskell.vim index e63515ce..5c33e550 100644 --- a/indent/haskell.vim +++ b/indent/haskell.vim @@ -36,9 +36,18 @@ endif if !exists('g:haskell_indent_let') " let x = 0 in " >>>>x + " + " let x = 0 + " y = 1 let g:haskell_indent_let = 4 endif +if !exists('g:haskell_indent_let_no_in') + " let x = 0 + " x + let g:haskell_indent_let_no_in = 4 +endif + if !exists('g:haskell_indent_where') " where f :: Int -> Int " >>>>>>f x = x @@ -210,6 +219,9 @@ function! GetHaskellIndent() " " let x = 1 " >>>>y = 2 + " + " let x = 1 + " y 2 if l:prevline =~ '\C\<let\>\s\+.\+$' if l:line =~ '\C^\s*\<let\>' let l:s = match(l:prevline, '\C\<let\>') @@ -221,11 +233,16 @@ function! GetHaskellIndent() if s:isSYN('haskellLet', v:lnum - 1, l:s + 1) return l:s + g:haskell_indent_in endif - else + elseif l:line =~ '\s=\s' let l:s = match(l:prevline, '\C\<let\>') if s:isSYN('haskellLet', v:lnum - 1, l:s + 1) return l:s + g:haskell_indent_let endif + else + let l:s = match(l:prevline, '\C\<let\>') + if s:isSYN('haskellLet', v:lnum - 1, l:s + 1) + return l:s + g:haskell_indent_let_no_in + endif endif endif |