diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-06-01 11:35:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-01 11:35:41 +0200 |
commit | ef33500e178e66880795eeaec21d5f6a530c52d5 (patch) | |
tree | 7488cd22ad533f1cf2949ad6d6cdddcae4089998 /src/nvim/getchar.c | |
parent | c6cd6081b8c449fa9890c18b5e2151e3af9bd45d (diff) | |
parent | afcfb7bd58a6ca98524f60f934852c31a288a9a5 (diff) | |
download | rneovim-ef33500e178e66880795eeaec21d5f6a530c52d5.tar.gz rneovim-ef33500e178e66880795eeaec21d5f6a530c52d5.tar.bz2 rneovim-ef33500e178e66880795eeaec21d5f6a530c52d5.zip |
Merge #10099 from janlazo/vim-8.1.1000
vim-patch:8.1.{1000,1436}
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index ef522242c6..7e4a0e1321 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1422,8 +1422,8 @@ int vgetc(void) } - /* a keypad or special function key was not mapped, use it like - * its ASCII equivalent */ + // a keypad or special function key was not mapped, use it like + // its ASCII equivalent switch (c) { case K_KPLUS: c = '+'; break; case K_KMINUS: c = '-'; break; @@ -1475,25 +1475,25 @@ int vgetc(void) case K_XRIGHT: c = K_RIGHT; break; } - /* For a multi-byte character get all the bytes and return the - * converted character. - * Note: This will loop until enough bytes are received! - */ - if (has_mbyte && (n = MB_BYTE2LEN_CHECK(c)) > 1) { + // For a multi-byte character get all the bytes and return the + // converted character. + // Note: This will loop until enough bytes are received! + if ((n = MB_BYTE2LEN_CHECK(c)) > 1) { no_mapping++; buf[0] = (char_u)c; for (i = 1; i < n; i++) { buf[i] = (char_u)vgetorpeek(true); if (buf[i] == K_SPECIAL ) { - /* Must be a K_SPECIAL - KS_SPECIAL - KE_FILLER sequence, - * which represents a K_SPECIAL (0x80), - * or a CSI - KS_EXTRA - KE_CSI sequence, which represents - * a CSI (0x9B), - * of a K_SPECIAL - KS_EXTRA - KE_CSI, which is CSI too. */ - c = vgetorpeek(TRUE); - if (vgetorpeek(TRUE) == (int)KE_CSI && c == KS_EXTRA) + // Must be a K_SPECIAL - KS_SPECIAL - KE_FILLER sequence, + // which represents a K_SPECIAL (0x80), + // or a CSI - KS_EXTRA - KE_CSI sequence, which represents + // a CSI (0x9B), + // of a K_SPECIAL - KS_EXTRA - KE_CSI, which is CSI too. + c = vgetorpeek(true); + if (vgetorpeek(true) == (int)KE_CSI && c == KS_EXTRA) { buf[i] = CSI; + } } } no_mapping--; |