Mercurial > vim
diff src/getchar.c @ 28610:ce202d2984a0 v8.2.4829
patch 8.2.4829: a key may be simplified to NUL
Commit: https://github.com/vim/vim/commit/17c95d9608370559441bb73941ba6d9a4b6b26bd
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue Apr 26 12:51:07 2022 +0100
patch 8.2.4829: a key may be simplified to NUL
Problem: A key may be simplified to NUL.
Solution: Use K_ZERO instead. Use macros instead of hard coded values.
(closes #10290)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 26 Apr 2022 14:00:03 +0200 |
parents | 4dcccb2673fe |
children | 6ff407067190 |
line wrap: on
line diff
--- a/src/getchar.c +++ b/src/getchar.c @@ -1637,7 +1637,11 @@ merge_modifyOtherKeys(int c_arg, int *mo if (*modifiers & MOD_MASK_CTRL) { if ((c >= '`' && c <= 0x7f) || (c >= '@' && c <= '_')) + { c &= 0x1f; + if (c == NUL) + c = K_ZERO; + } else if (c == '6') // CTRL-6 is equivalent to CTRL-^ c = 0x1e; @@ -3661,7 +3665,7 @@ inchar( for (;;) { len = ui_inchar(dum, DUM_LEN, 0L, 0); - if (len == 0 || (len == 1 && dum[0] == 3)) + if (len == 0 || (len == 1 && dum[0] == Ctrl_C)) break; } return retesc;