aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-06 09:00:24 -0400
committerGitHub <noreply@github.com>2021-05-06 09:00:24 -0400
commit71107e12c7b68d8faf1bcc1a5794a55b21e146f3 (patch)
tree57623fc268dbf5d2a919f04aa3d66c78bff78cb4 /src/nvim/getchar.c
parent8a93d1028f38c77d7ad8b4ad0a93dc11a5cbe85d (diff)
parent296711cfad7bb8d80f2e2c363b3708764156444f (diff)
downloadrneovim-71107e12c7b68d8faf1bcc1a5794a55b21e146f3.tar.gz
rneovim-71107e12c7b68d8faf1bcc1a5794a55b21e146f3.tar.bz2
rneovim-71107e12c7b68d8faf1bcc1a5794a55b21e146f3.zip
Merge pull request #14499 from janlazo/vim-8.2.2819
vim-patch:8.0.1309,8.2.{1166,2819,2820,2825,2827,2828,2829,2832,2833}
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 9afce6e9d5..5c2eed363e 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1322,7 +1322,7 @@ void openscript(
do {
update_topline_cursor(); // update cursor position and topline
normal_cmd(&oa, false); // execute one command
- vpeekc(); // check for end of file
+ (void)vpeekc(); // check for end of file
} while (scriptin[oldcurscript] != NULL);
State = save_State;
@@ -1586,7 +1586,9 @@ int plain_vgetc(void)
do {
c = safe_vgetc();
- } while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
+ } while (c == K_IGNORE
+ || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR
+ || c == K_MOUSEMOVE);
return c;
}
@@ -3831,7 +3833,16 @@ bool check_abbr(int c, char_u *ptr, int col, int mincol)
if (c >= ABBR_OFF) {
c -= ABBR_OFF;
}
- j += utf_char2bytes(c, tb + j);
+ int newlen = utf_char2bytes(c, tb + j);
+ tb[j + newlen] = NUL;
+ // Need to escape K_SPECIAL.
+ char_u *escaped = vim_strsave_escape_csi(tb + j);
+ if (escaped != NULL) {
+ newlen = (int)STRLEN(escaped);
+ memmove(tb + j, escaped, (size_t)newlen);
+ j += newlen;
+ xfree(escaped);
+ }
}
tb[j] = NUL;
// insert the last typed char