comparison src/ui.c @ 26727:077277ee1626 v8.2.3892

patch 8.2.3892: when modifyOtherKeys is used CTRL-C is not recognized Commit: https://github.com/vim/vim/commit/35cfd793aad7c4bfba4a9bedf5c435c44e4293d0 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 25 15:13:18 2021 +0000 patch 8.2.3892: when modifyOtherKeys is used CTRL-C is not recognized Problem: When modifyOtherKeys is used CTRL-C is not recognized. Solution: Check for uppercase C as well, fix minimum length.
author Bram Moolenaar <Bram@vim.org>
date Sat, 25 Dec 2021 16:15:02 +0100
parents fac6673086df
children 41e0dcf38521
comparison
equal deleted inserted replaced
26726:4303d746ebe6 26727:077277ee1626
1026 inbufcount -= unconverted; 1026 inbufcount -= unconverted;
1027 len = convert_input_safe(inbuf + inbufcount, 1027 len = convert_input_safe(inbuf + inbufcount,
1028 len + unconverted, INBUFLEN - inbufcount, 1028 len + unconverted, INBUFLEN - inbufcount,
1029 rest == NULL ? &rest : NULL, &restlen); 1029 rest == NULL ? &rest : NULL, &restlen);
1030 } 1030 }
1031 while (len-- > 0) 1031 while (len > 0)
1032 { 1032 {
1033 // If a CTRL-C was typed, remove it from the buffer and set 1033 // If a CTRL-C was typed, remove it from the buffer and set
1034 // got_int. Also recognize CTRL-C with modifyOtherKeys set, in two 1034 // got_int. Also recognize CTRL-C with modifyOtherKeys set, lower
1035 // forms. 1035 // and upper case, in two forms.
1036 if (ctrl_c_interrupts && (inbuf[inbufcount] == 3 1036 if (ctrl_c_interrupts && (inbuf[inbufcount] == 3
1037 || (len >= 10 && STRNCMP(inbuf + inbufcount, 1037 || (len >= 10 && STRNCMP(inbuf + inbufcount,
1038 "\033[27;5;99~", 10) == 0) 1038 "\033[27;5;99~", 10) == 0)
1039 || (len >= 10 && STRNCMP(inbuf + inbufcount,
1040 "\033[27;5;67~", 10) == 0)
1039 || (len >= 7 && STRNCMP(inbuf + inbufcount, 1041 || (len >= 7 && STRNCMP(inbuf + inbufcount,
1040 "\033[99;5u", 7) == 0))) 1042 "\033[99;5u", 7) == 0)
1043 || (len >= 7 && STRNCMP(inbuf + inbufcount,
1044 "\033[67;5u", 7) == 0)))
1041 { 1045 {
1042 // remove everything typed before the CTRL-C 1046 // remove everything typed before the CTRL-C
1043 mch_memmove(inbuf, inbuf + inbufcount, (size_t)(len + 1)); 1047 mch_memmove(inbuf, inbuf + inbufcount, (size_t)(len));
1044 inbufcount = 0; 1048 inbufcount = 0;
1045 got_int = TRUE; 1049 got_int = TRUE;
1046 } 1050 }
1051 --len;
1047 ++inbufcount; 1052 ++inbufcount;
1048 } 1053 }
1049 } 1054 }
1050 #endif // UNIX || VMS || MACOS_X 1055 #endif // UNIX || VMS || MACOS_X
1051 } 1056 }