Skip to content

Commit 844ceba

Browse files
Fix Infinte loop in RestoreSearchHistory (#151)
1 parent c63394d commit 844ceba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugin/better-whitespace.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ endif
118118

119119
" Function that clears the search entries of BetterWhiteSpace by rolling back to the given index
120120
function! s:RestoreSearchHistory(index)
121-
while histnr('search') > a:index
121+
while histnr('search') > max([a:index, 0])
122122
call histdel('search', -1)
123123
endwhile
124124
let @/ = histget('search', -1)

0 commit comments

Comments
 (0)