summaryrefslogtreecommitdiffstats
path: root/indent/haskell.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2016-05-31 01:53:12 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2016-05-31 01:53:12 +0200
commit44b3d860cb85ccb4edd52fb0dcf6a4102d12e82a (patch)
tree537e871f1d923c01c3d5098fd2958c198d093977 /indent/haskell.vim
parent5a65ffe66d19da9989ae6b71962830ca6c80f5b5 (diff)
downloadvim-polyglot-2.9.1.tar.gz
vim-polyglot-2.9.1.zip
Updatev2.9.1
Diffstat (limited to 'indent/haskell.vim')
-rw-r--r--indent/haskell.vim22
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