File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,24 @@ if !exists('g:haskell_indent_let')
3737 let g: haskell_indent_let = 4
3838endif
3939
40+ if ! exists (' g:haskell_indent_before_where' )
41+ " f x = g
42+ " >>where
43+ let g: haskell_indent_before_where = &shiftwidth
44+ endif
45+
4046if ! exists (' g:haskell_indent_where' )
4147 " where f :: Int -> Int
4248 " >>>>>>f x = x
4349 let g: haskell_indent_where = 6
4450endif
4551
52+ if ! exists (' g:haskell_indent_after_bare_where' )
53+ " where
54+ " >>g y = x y
55+ let g: haskell_indent_after_bare_where = &shiftwidth
56+ endif
57+
4658if ! exists (' g:haskell_indent_do' )
4759 " do x <- a
4860 " >>>y <- b
@@ -243,12 +255,16 @@ function! GetHaskellIndent()
243255 " where
244256 " >>foo
245257 "
258+ if l: prevline = ~ ' \C\<where\>\s*$'
259+ return match (l: prevline , ' \S' ) + g: haskell_indent_after_bare_where
260+ endif
261+
246262 " do
247263 " >>foo
248264 "
249265 " foo =
250266 " >>bar
251- if l: prevline = ~ ' \C\(\<where\>\|\< do\>\|=\)\s*$'
267+ if l: prevline = ~ ' \C\(\<do\>\|=\)\s*$'
252268 return match (l: prevline , ' \S' ) + &shiftwidth
253269 endif
254270
@@ -405,7 +421,7 @@ function! GetHaskellIndent()
405421 return match (l: prevline , ' in' ) - g: haskell_indent_in
406422 endif
407423
408- return match (l: prevline , ' \S' ) + & shiftwidth
424+ return match (l: prevline , ' \S' ) + g: haskell_indent_before_where
409425 endif
410426
411427 " let x = 1
You can’t perform that action at this time.
0 commit comments