Bug in :set-termcap

51 views
Skip to first unread message

Matt Wozniski

unread,
Dec 13, 2008, 3:06:00 AM12/13/08
to vim...@googlegroups.com
At :help :set-termcap, an example shows the command

:set <M-b>=^[b

This command does not work as expected when 'encoding' is set to
something multibyte. The reason seems to be that vim recognizes the
input bytes 0x1B 0x62 as a metafied 'b', and then stuffs 0xE2 into its
internal text buffers - a byte which is not reasonable unicode. As a
result, vim continues waiting for more bytes to finish the
(unintentional) sequence, until it gives up, decides that the sequence
is invalid multibyte, and just returns the first byte as a character.
The attached patch fixes this by stuffing the multibyte bytes
corresponding to the given codepoint into the input buffer instead.
I'm not sure if there's a better way to handle changing the size of
MAX_KEY_CODE_LEN in src/keymap.h, but Bram will know for sure.

~Matt

set-termcap-multibyte.patch

Bram Moolenaar

unread,
Dec 13, 2008, 8:48:26 AM12/13/08
to Matt Wozniski, vim...@googlegroups.com

Matt Wozniski wrote:

Thanks for the patch. This stuff is a bit complicated, it does looks
like your solution is the right one.

--
Why isn't there mouse-flavored cat food?

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Reply all
Reply to author
Forward
0 new messages