summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-29 21:23:25 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-29 21:23:25 +0200
commitf43e7ac4eee22dbb26fc069ec9a3d1598ec8dfe9 (patch)
tree65ec6d521b22fcd11a923e9773495f8b1fd67fde /src/terminal.c
parent391c36279415d0b8c5dba1ba11b668add04be963 (diff)
downloadvim-git-f43e7ac4eee22dbb26fc069ec9a3d1598ec8dfe9.tar.gz
patch 8.2.1772: cannot use CTRL-W <Down> to move out of a terminal windowv8.2.1772
Problem: Cannot use CTRL-W <Down> to move out of a terminal window. Solution: Use special_to_buf() instead of mb_char2bytes(). (closes #7045)
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/terminal.c b/src/terminal.c
index 2043c8487..867a0e3f3 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -2640,12 +2640,13 @@ if (raw_c > 0)
}
else if (termwinkey == 0 || c != termwinkey)
{
- char_u buf[MB_MAXBYTES + 2];
+ // space for CTRL-W, modifier, multi-byte char and NUL
+ char_u buf[1 + 3 + MB_MAXBYTES + 1];
// Put the command into the typeahead buffer, when using the
// stuff buffer KeyStuffed is set and 'langmap' won't be used.
buf[0] = Ctrl_W;
- buf[(*mb_char2bytes)(c, buf + 1) + 1] = NUL;
+ buf[special_to_buf(c, mod_mask, FALSE, buf + 1) + 1] = NUL;
ins_typebuf(buf, REMAP_NONE, 0, TRUE, FALSE);
ret = OK;
goto theend;