Skip to content

Fix case of multiple 'do' blocks on the same line #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions indent/haskell.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
" Filename: indent/haskell.vim
" Author: itchyny
" License: MIT License
" Last Change: 2024/11/01 20:51:18.
" Last Change: 2025/03/03 09:45:31.
" =============================================================================

if exists('b:did_indent')
Expand Down Expand Up @@ -128,7 +128,7 @@ function! GetHaskellIndent() abort
endif

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

if line =~# '\v<if>' && line !~# '\v^\s*#'
Expand Down
3 changes: 3 additions & 0 deletions test/do/double_do.in.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
do foo <- do undo <- baz
qux
quux
3 changes: 3 additions & 0 deletions test/do/double_do.out.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
do foo <- do undo <- baz
qux
quux