Skip to content

Commit 0206921

Browse files
committed
draft
1 parent 16c5e41 commit 0206921

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

indent/haskell.vim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ function! GetHaskellIndent() abort
7676
endif
7777

7878
" =
79+
if line =~# '\v\='
80+
if getline(v:lnum - 1) =~# '\v^\s*-\>'
81+
return indent(v:lnum - 1) - &shiftwidth
82+
endif
83+
endif
84+
7985
if line =~# '\v^\s*\='
8086
return s:indent_eq()
8187
endif
@@ -106,6 +112,11 @@ function! GetHaskellIndent() abort
106112

107113
let line = getline(v:lnum - 1)
108114

115+
" ::
116+
if line =~# '::\s*$'
117+
return indent(v:lnum - 1) + &shiftwidth
118+
endif
119+
109120
" #if, #else, #endif, #include
110121
if nonblankline =~# '^\s*#'
111122
return 0

test/typesig/typesig.in.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
foo ::
2+
Int
3+
-> Int
4+
foo = bar

test/typesig/typesig.out.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
foo ::
2+
Int
3+
-> Int
4+
foo = bar

0 commit comments

Comments
 (0)