emacs-evil / evil-surround

you will be surrounded (surround.vim for evil, the extensible vi layer)
Other
631 stars 61 forks source link

use read-key instead of read-char -- handles unicode better #114

Closed willghatch closed 7 years ago

willghatch commented 7 years ago

read-char in the terminal will read only part of a multibyte unicode character input from the keyboard, whereas read-key reads the whole thing. This goes along with a pull request I've sent to the evil repository to fix the same thing (https://github.com/emacs-evil/evil/pull/857).

ninrod commented 7 years ago

@willghatch. thanks.

I must say that this read-key thing was the main culprit of a very painful regression on evil-surround which I had to revert. It broke the . operation on evil-surround, which is the main feature of evil-surround.

In fact, without the . operator, surround is almost useless. you could just ciw""<esc>p instead.

Anyway, I'm very, very nervous to merge this in.

In fact, I'd ask of you to write a test just so we can at least assure that the main . functionality remains untouched.

willghatch commented 7 years ago

Don't merge this. It did break it. I'm at a loss as to how to fix the current problem now, though -- evil-surround has always been broken for me for unicode charcters and I spent a while this morning tracking it down to read-char. I'll make a separate issue, since my PR doesn't fix it acceptably.