comparison src/getchar.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 a52697bcffa6
children 25f6c7f77c70
comparison
equal deleted inserted replaced
31155:9173a376f251 31156:0ecb16d5f86f
2776 if (keylen == 0 && save_keylen == KEYLEN_PART_KEY && !*timedout) 2776 if (keylen == 0 && save_keylen == KEYLEN_PART_KEY && !*timedout)
2777 keylen = KEYLEN_PART_KEY; 2777 keylen = KEYLEN_PART_KEY;
2778 2778
2779 // If no termcode matched, try to include the modifier into the 2779 // If no termcode matched, try to include the modifier into the
2780 // key. This is for when modifyOtherKeys is working. 2780 // key. This is for when modifyOtherKeys is working.
2781 #ifdef FEAT_TERMINAL
2782 check_no_reduce_keys(); // may update the no_reduce_keys flag
2783 #endif
2781 if (keylen == 0 && !no_reduce_keys) 2784 if (keylen == 0 && !no_reduce_keys)
2782 { 2785 {
2783 keylen = check_simplify_modifier(max_mlen + 1); 2786 keylen = check_simplify_modifier(max_mlen + 1);
2784 if (keylen < 0) 2787 if (keylen < 0)
2785 // ins_typebuf() failed 2788 // ins_typebuf() failed
3917 } 3920 }
3918 if (c1 == Ctrl_V) 3921 if (c1 == Ctrl_V)
3919 { 3922 {
3920 // CTRL-V is followed by octal, hex or other characters, reverses 3923 // CTRL-V is followed by octal, hex or other characters, reverses
3921 // what AppendToRedobuffLit() does. 3924 // what AppendToRedobuffLit() does.
3922 no_reduce_keys = TRUE; // don't merge modifyOtherKeys 3925 ++no_reduce_keys; // don't merge modifyOtherKeys
3923 c1 = get_literal(TRUE); 3926 c1 = get_literal(TRUE);
3924 no_reduce_keys = FALSE; 3927 --no_reduce_keys;
3925 } 3928 }
3926 3929
3927 if (got_int) 3930 if (got_int)
3928 aborted = TRUE; 3931 aborted = TRUE;
3929 else if (c1 == '\r' || c1 == '\n') 3932 else if (c1 == '\r' || c1 == '\n')