Skip to content

Commit 21211f4

Browse files
committed
Fix plugin causing error bell
This fixes #29. The error bell is caused by unnecessary pressing of <Esc> from Normal mode. The plugin now is more strict about when executing <Esc> is necessary.
1 parent af36913 commit 21211f4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.15 (04/22/2013)
2+
3+
Bugfixes:
4+
- Fix plugin causing error bell. This fixes #29.
5+
16
## 1.14 (04/22/2013)
27

38
Features:

autoload/multiple_cursors.vim

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,10 @@ function! multiple_cursors#new(mode)
110110
" Start in normal mode
111111
call s:wait_for_user_input('n')
112112
else
113-
" Save the '< and '> marks
114-
call s:exit_visual_mode()
115-
116113
" Came directly from visual mode
117114
if s:cm.is_empty()
118115
call s:cm.reset(0)
116+
119117
if visualmode() ==# 'V'
120118
let left = [line('.'), 1]
121119
let right = [line('.'), col('$')-1]
@@ -413,13 +411,12 @@ function! s:CursorManager.update_current() dict
413411
" If we're in visual line mode, we need to go to visual mode before we can
414412
" update the visual region
415413
if s:to_mode ==# 'V'
416-
normal! gvv
414+
exec "normal! gvv\<Esc>"
417415
endif
418416

419417
" Sets the cursor at the right place
420-
call s:exit_visual_mode()
418+
exec "normal! gv\<Esc>"
421419
call cur.update_visual_selection(s:get_visual_region(s:pos('.')))
422-
call s:exit_visual_mode()
423420
else
424421
call cur.remove_visual_selection()
425422
endif
@@ -832,8 +829,6 @@ function! s:exit()
832829
let exit = 1
833830
elseif (s:from_mode ==# 'v' || s:from_mode ==# 'V') &&
834831
\ g:multi_cursor_exit_from_visual_mode
835-
" This isn't strictly necessary, but good to do nonetheless
836-
call s:exit_visual_mode()
837832
let exit = 1
838833
elseif s:from_mode ==# 'i' && g:multi_cursor_exit_from_insert_mode
839834
stopinsert

0 commit comments

Comments
 (0)