Skip to content

Commit 16c5e41

Browse files
authored
Fix case of multiple 'do' blocks on the same line (#36)
1 parent 65647b8 commit 16c5e41

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

indent/haskell.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
" Filename: indent/haskell.vim
33
" Author: itchyny
44
" License: MIT License
5-
" Last Change: 2024/11/01 20:51:18.
5+
" Last Change: 2025/03/03 09:45:31.
66
" =============================================================================
77

88
if exists('b:did_indent')
@@ -128,7 +128,7 @@ function! GetHaskellIndent() abort
128128
endif
129129

130130
if nonblankline =~# '\v<do>\s*[[:alnum:](]'
131-
return match(nonblankline, '\v<do>\s*\zs\S')
131+
return match(nonblankline, '\v.*<do>\s*\zs')
132132
endif
133133

134134
if line =~# '\v<if>' && line !~# '\v^\s*#'

test/do/double_do.in.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
do foo <- do undo <- baz
2+
qux
3+
quux

test/do/double_do.out.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
do foo <- do undo <- baz
2+
qux
3+
quux

0 commit comments

Comments
 (0)