mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-10 20:43:52 -05:00
Update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user