gabesoft / evil-mc

Multiple cursors implementation for evil-mode
MIT License
387 stars 36 forks source link

key-chords do not work #12

Closed PythonNut closed 8 years ago

PythonNut commented 8 years ago

Given the following:

(key-chord-define evil-insert-state-map "jj" #'evil-normal-state)

When I execute jj to enter normal state, I get misaligned cursors and the following error:

Error in pre-command-hook (evil-mc-begin-command-save): (user-error "Key sequence contains no complete binding") evil-mc Failed to execute nil with error: Keyboard macro terminated by a command ringing the bell

This is due to the way key-chord handles keyboard macros.

From the docs:

When recording keyboard macros, the time between keyboard inputs are not recorded. Thus, the key-chord-input-method cannot know for sure if two keys in a macro was a chord or not. The current solution remembers the first key of the chords typed during macro recording, and keys that match those (and are defined as chords) are considered key-chords during macro execution. This knowledge is not saved with name-last-kbd-macro, so they may execute wrong if they contain pair of keys that match defined chords.

gabesoft commented 8 years ago

Yea, I wasn't actually planning on supporting key-chord. Getting the correct key sequence for a command is kind of problematic as it is. With key-chord that gets even more complicated. I'll think about it but I can't promise anything. For now you could disable key-chord while the cursors are active by re-defining evil-mc-incompatible-minor-modes before enabling evil-mc-mode.

PythonNut commented 8 years ago

Sure. I'll leave this open, you can close it if at any time you decide that it's not worth the effort.

gabesoft commented 8 years ago

I'm closing this for now, as it doesn't look like I'll have time to work on it anytime soon. I'll re-open it when I'll have more time.

PythonNut commented 8 years ago

Sure thing.

Martinsos commented 1 year ago

I think I am having the same problem -> I use "fd" to exit the insert mode, instead of Esc, and each time I type fd, there remains an "f" in one of the cursors. Is there any way to go around this? Thanks!