Skip to content

Commit 99171c8

Browse files
committed
Ignore 'do' matches inside words
1 parent f5ae0ac commit 99171c8

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

indent/haskell.vim

Lines changed: 2 additions & 3 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: 2025/03/01 19:41:22.
5+
" Last Change: 2025/03/03 09:45:31.
66
" =============================================================================
77

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

130130
if nonblankline =~# '\v<do>\s*[[:alnum:](]'
131-
let i = strridx(nonblankline, 'do ')
132-
return match(nonblankline, '\v<do>\s*\zs', i)
131+
return match(nonblankline, '\v.*<do>\s*\zs')
133132
endif
134133

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

test/do/double_do.in.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
do foo <- do bar <- baz
1+
do foo <- do undo <- baz
22
qux
33
quux

test/do/double_do.out.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
do foo <- do bar <- baz
1+
do foo <- do undo <- baz
22
qux
33
quux

0 commit comments

Comments
 (0)