gabesoft / evil-mc

Multiple cursors implementation for evil-mode
MIT License
383 stars 35 forks source link

wrong location for substitution on fake cursors when `evil-move-cursor-back` is `nil` #129

Open josephmturner opened 2 years ago

josephmturner commented 2 years ago

Running emacs 27.2 with just this config:

(require 'evil)
(evil-mode 1)
(setq evil-move-cursor-back nil) ;; Entering and leaving insert mode is idempotent
(require 'evil-mc)
(global-evil-mc-mode 1)

Given a buffer with the following text:

a b c
a b c
a b c

Place your cursor on b in the first line then run evil-mc-make-and-goto-next-match twice (C-n C-n). You should now have a fake cursor on the first two bs, and the real cursor on the third. Run evil-substitute (s). Expected result:

a  c
a  c
a  c

Actual result:

a bc
a bc
a  c

In both cases, you should be in insert state as expected.