Skip to content

Commit 4bd6150

Browse files
committed
unify while loops
1 parent 2c6f457 commit 4bd6150

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

indent/haskell.vim

+4-4
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ function! GetHaskellIndent()
342342
else
343343
let l:m = matchstr(l:line, '^\s*\zs\<\S\+\>\ze')
344344
let l:l = l:prevline
345-
let l:c = 1
345+
let l:c = v:lnum - 1
346346

347-
while v:lnum != l:c
347+
while l:c >= 1
348348
" fun decl
349349
if l:l =~ ('^\s*' . l:m . '\(\s*::\|\n\s\+::\)')
350350
let l:s = match(l:l, l:m)
@@ -357,8 +357,8 @@ function! GetHaskellIndent()
357357
elseif l:l =~ '^$'
358358
return 0
359359
endif
360-
let l:c += 1
361-
let l:l = getline(v:lnum - l:c)
360+
let l:c -= 1
361+
let l:l = getline(l:c)
362362
endwhile
363363

364364
return 0

0 commit comments

Comments
 (0)