gabesoft / evil-mc

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

`esc` unaligns the cursors, when real cursor on first column #124

Open duianto opened 2 years ago

duianto commented 2 years ago

esc unaligns the cursors when the real cursor is on the first column, but at least one fake cursor is not.

Reproduction steps

With multiple words in a buffer. and at least one word is indented.

abc
  abc
    abc

Observed

The fake cursors moved to the left once. They are now unaligned with the real cursor.

[a]bc
 [ ]abc
   [ ]abc

Expected

The cursors should remain aligned.

[a]bc
  [a]bc
    [a]bc

System Info

evil-mc-20210730.1752 GNU Emacs 27.2 (build 1, x86_64-w64-mingw32) of 2021-03-26 Windows 21H1

duianto commented 2 years ago

This might not have an easy/desired fix.

The default behavior in Vim when exiting (esc) from insert state to normal state, is that the cursor moves back. This causes the evil-mc cursors to become unaligned, when the real or a fake cursor is at the beginning of a line.

[a]bc
  |abc
    [a]bc

esc moves back the cursors that are not at the beginning of their lines

[a]bc
 [ ]abc
   [ ]abc