Skip to content

Commit d3d7d02

Browse files
committed
prioritize comma indentation
1 parent 2a95942 commit d3d7d02

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

indent/haskell.vim

+26-26
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,32 @@ function! GetHaskellIndent()
140140
endif
141141
endif
142142

143+
" { foo :: Int
144+
" >>,
145+
"
146+
" |
147+
" ...
148+
" >>,
149+
if l:line =~ '^\s*,'
150+
if s:isInBlock(l:hlstack)
151+
normal! 0
152+
call search(',', 'cW')
153+
let l:n = s:getNesting(s:getHLStack())
154+
call search('[([{]', 'bW')
155+
156+
while l:n != s:getNesting(s:getHLStack())
157+
call search('[([{]', 'bW')
158+
endwhile
159+
160+
return col('.') - 1
161+
else
162+
let l:s = s:indentGuard(match(l:line, ','), l:prevline)
163+
if l:s > -1
164+
return l:s
165+
end
166+
endif
167+
endif
168+
143169
" operator at end of previous line
144170
if l:prevline =~ '[!#$%&*+./<>?@\\^|~-]\s*$'
145171
return match(l:prevline, '\S') + &shiftwidth
@@ -363,32 +389,6 @@ function! GetHaskellIndent()
363389
endif
364390
endif
365391

366-
" { foo :: Int
367-
" >>,
368-
"
369-
" |
370-
" ...
371-
" >>,
372-
if l:line =~ '^\s*,'
373-
if s:isInBlock(l:hlstack)
374-
normal! 0
375-
call search(',', 'cW')
376-
let l:n = s:getNesting(s:getHLStack())
377-
call search('[([{]', 'bW')
378-
379-
while l:n != s:getNesting(s:getHLStack())
380-
call search('[([{]', 'bW')
381-
endwhile
382-
383-
return col('.') - 1
384-
else
385-
let l:s = s:indentGuard(match(l:line, ','), l:prevline)
386-
if l:s > -1
387-
return l:s
388-
end
389-
endif
390-
endif
391-
392392
" |
393393
" ...
394394
" >>|

0 commit comments

Comments
 (0)