diff options
Diffstat (limited to 'indent/haskell.vim')
-rw-r--r-- | indent/haskell.vim | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/indent/haskell.vim b/indent/haskell.vim index 891e659a..b2767e1e 100644 --- a/indent/haskell.vim +++ b/indent/haskell.vim @@ -113,24 +113,22 @@ function! GetHaskellIndent() let l:hlstack = s:getHLStack() " do not indent in strings and quasiquotes - if index(l:hlstack, 'haskellString') > -1 || index(l:hlstack, 'haskellQuasiQuote') > -1 + if index(l:hlstack, 'haskellQuasiQuote') > -1 || index(l:hlstack, 'haskellBlockComment') > -1 return -1 endif - " blockcomment handling - if index(l:hlstack, 'haskellBlockComment') > -1 - for l:c in range(v:lnum - 1, 0, -1) - let l:line = getline(l:c) - if l:line =~ '{-' - return 1 + match(l:line, '{-') - endif - endfor - return 1 - endif - let l:prevline = getline(v:lnum - 1) let l:line = getline(v:lnum) + " indent multiline strings + if index(l:hlstack, 'haskellString') > -1 + if l:line =~ '^\s*\\' + return match(l:prevline, '["\\]') + else + return - 1 + endif + endif + " reset if l:prevline =~ '^\s*$' && l:line !~ '^\s*\S' return 0 |