comparison src/terminal.c @ 22448:5e287462487e v8.2.1772

patch 8.2.1772: cannot use CTRL-W <Down> to move out of a terminal window Commit: https://github.com/vim/vim/commit/f43e7ac4eee22dbb26fc069ec9a3d1598ec8dfe9 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 29 21:23:25 2020 +0200 patch 8.2.1772: cannot use CTRL-W <Down> to move out of a terminal window Problem: Cannot use CTRL-W <Down> to move out of a terminal window. Solution: Use special_to_buf() instead of mb_char2bytes(). (closes https://github.com/vim/vim/issues/7045)
author Bram Moolenaar <Bram@vim.org>
date Tue, 29 Sep 2020 21:30:03 +0200
parents 0bbc8be90207
children 73688eec32ca
comparison
equal deleted inserted replaced
22447:0d08767cdb3e 22448:5e287462487e
2638 term_paste_register(prev_c); 2638 term_paste_register(prev_c);
2639 continue; 2639 continue;
2640 } 2640 }
2641 else if (termwinkey == 0 || c != termwinkey) 2641 else if (termwinkey == 0 || c != termwinkey)
2642 { 2642 {
2643 char_u buf[MB_MAXBYTES + 2]; 2643 // space for CTRL-W, modifier, multi-byte char and NUL
2644 char_u buf[1 + 3 + MB_MAXBYTES + 1];
2644 2645
2645 // Put the command into the typeahead buffer, when using the 2646 // Put the command into the typeahead buffer, when using the
2646 // stuff buffer KeyStuffed is set and 'langmap' won't be used. 2647 // stuff buffer KeyStuffed is set and 'langmap' won't be used.
2647 buf[0] = Ctrl_W; 2648 buf[0] = Ctrl_W;
2648 buf[(*mb_char2bytes)(c, buf + 1) + 1] = NUL; 2649 buf[special_to_buf(c, mod_mask, FALSE, buf + 1) + 1] = NUL;
2649 ins_typebuf(buf, REMAP_NONE, 0, TRUE, FALSE); 2650 ins_typebuf(buf, REMAP_NONE, 0, TRUE, FALSE);
2650 ret = OK; 2651 ret = OK;
2651 goto theend; 2652 goto theend;
2652 } 2653 }
2653 } 2654 }