Mercurial > vim
comparison src/misc2.c @ 31156:0ecb16d5f86f v9.0.0912
patch 9.0.0912: libvterm with modifyOtherKeys level 2 does not match xterm
Commit: https://github.com/vim/vim/commit/c896adbcdee8b2296433a61c1f009aae9f68a594
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 19 19:02:40 2022 +0000
patch 9.0.0912: libvterm with modifyOtherKeys level 2 does not match xterm
Problem: libvterm with modifyOtherKeys level 2 does not match xterm.
Solution: Adjust key code escape sequences to be the same as what xterm
sends in modifyOtherKeys level 2 mode. Check the value of
no_reduce_keys before using it.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 19 Nov 2022 20:15:03 +0100 |
parents | cc0c4141fb73 |
children | 6fa4f94aca5a |
comparison
equal
deleted
inserted
replaced
31155:9173a376f251 | 31156:0ecb16d5f86f |
---|---|
1514 * Some keys are used with Ctrl without Shift and are still expected to be | 1514 * Some keys are used with Ctrl without Shift and are still expected to be |
1515 * mapped as if Shift was pressed: | 1515 * mapped as if Shift was pressed: |
1516 * CTRL-2 is CTRL-@ | 1516 * CTRL-2 is CTRL-@ |
1517 * CTRL-6 is CTRL-^ | 1517 * CTRL-6 is CTRL-^ |
1518 * CTRL-- is CTRL-_ | 1518 * CTRL-- is CTRL-_ |
1519 * Also, <C-H> and <C-h> mean the same thing, always use "H". | 1519 * Also, unless no_reduce_keys is set then <C-H> and <C-h> mean the same thing, |
1520 * use "H". | |
1520 * Returns the possibly adjusted key. | 1521 * Returns the possibly adjusted key. |
1521 */ | 1522 */ |
1522 int | 1523 int |
1523 may_adjust_key_for_ctrl(int modifiers, int key) | 1524 may_adjust_key_for_ctrl(int modifiers, int key) |
1524 { | 1525 { |
1525 if (modifiers & MOD_MASK_CTRL) | 1526 if (modifiers & MOD_MASK_CTRL) |
1526 { | 1527 { |
1527 if (ASCII_ISALPHA(key)) | 1528 if (ASCII_ISALPHA(key)) |
1528 return TOUPPER_ASC(key); | 1529 { |
1530 #ifdef FEAT_TERMINAL | |
1531 check_no_reduce_keys(); // may update the no_reduce_keys flag | |
1532 #endif | |
1533 return no_reduce_keys == 0 ? TOUPPER_ASC(key) : key; | |
1534 } | |
1529 if (key == '2') | 1535 if (key == '2') |
1530 return '@'; | 1536 return '@'; |
1531 if (key == '6') | 1537 if (key == '6') |
1532 return '^'; | 1538 return '^'; |
1533 if (key == '-') | 1539 if (key == '-') |