Skip to content

Commit 00219a9

Browse files
committed
Fix regression
Fix regression where `C-n` doesn't exhibit correct behavior when all matches have been found
1 parent c249186 commit 00219a9

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.11 (04/18/2013)
2+
3+
Bugfixes:
4+
- Fix regression where `C-n` doesn't exhibit correct behavior when all matches have been found
5+
- Clear echo messages when a new input is received
6+
17
## 1.10 (04/17/2013)
28

39
Bugfixes:

autoload/multiple_cursors.vim

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,12 @@ function! multiple_cursors#new(mode)
129129
endif
130130
let content = s:get_text(s:region("'<", "'>"))
131131
let next = s:find_next(content)
132-
call s:cm.add(next[1], next)
133-
call s:update_visual_markers(next)
132+
if s:cm.add(next[1], next)
133+
call s:update_visual_markers(next)
134+
else
135+
call cursor(s:cm.get_current().position)
136+
echohl WarningMsg | echo 'No more matches' | echohl None
137+
endif
134138
call s:wait_for_user_input('v')
135139
endif
136140
endif
@@ -206,7 +210,7 @@ function! multiple_cursors#find(start, end, pattern)
206210
echohl ErrorMsg | echo 'No match found' | echohl None
207211
return
208212
else
209-
echohl Normal | echo 'Added '.s:cm.size().' cursor'.(s:cm.size()>1?'s':'')
213+
echohl Normal | echo 'Added '.s:cm.size().' cursor'.(s:cm.size()>1?'s':'') | echohl None
210214
call s:wait_for_user_input('v')
211215
endif
212216
endfunction
@@ -871,6 +875,9 @@ function! s:wait_for_user_input(mode)
871875

872876
let s:char = s:get_char()
873877

878+
" Clears any echoes we might've added
879+
normal! :<Esc>
880+
874881
if s:exit()
875882
return
876883
endif

0 commit comments

Comments
 (0)