To: vim_dev@googlegroups.com Subject: Patch 8.2.3892 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.3892 Problem: When modifyOtherKeys is used CTRL-C is not recognized. Solution: Check for uppercase C as well, fix minimum length. Files: src/ui.c *** ../vim-8.2.3891/src/ui.c 2021-12-16 20:56:52.952098567 +0000 --- src/ui.c 2021-12-25 15:12:59.620462891 +0000 *************** *** 1028,1049 **** len + unconverted, INBUFLEN - inbufcount, rest == NULL ? &rest : NULL, &restlen); } ! while (len-- > 0) { // If a CTRL-C was typed, remove it from the buffer and set ! // got_int. Also recognize CTRL-C with modifyOtherKeys set, in two ! // forms. if (ctrl_c_interrupts && (inbuf[inbufcount] == 3 || (len >= 10 && STRNCMP(inbuf + inbufcount, "\033[27;5;99~", 10) == 0) || (len >= 7 && STRNCMP(inbuf + inbufcount, ! "\033[99;5u", 7) == 0))) { // remove everything typed before the CTRL-C ! mch_memmove(inbuf, inbuf + inbufcount, (size_t)(len + 1)); inbufcount = 0; got_int = TRUE; } ++inbufcount; } } --- 1028,1054 ---- len + unconverted, INBUFLEN - inbufcount, rest == NULL ? &rest : NULL, &restlen); } ! while (len > 0) { // If a CTRL-C was typed, remove it from the buffer and set ! // got_int. Also recognize CTRL-C with modifyOtherKeys set, lower ! // and upper case, in two forms. if (ctrl_c_interrupts && (inbuf[inbufcount] == 3 || (len >= 10 && STRNCMP(inbuf + inbufcount, "\033[27;5;99~", 10) == 0) + || (len >= 10 && STRNCMP(inbuf + inbufcount, + "\033[27;5;67~", 10) == 0) + || (len >= 7 && STRNCMP(inbuf + inbufcount, + "\033[99;5u", 7) == 0) || (len >= 7 && STRNCMP(inbuf + inbufcount, ! "\033[67;5u", 7) == 0))) { // remove everything typed before the CTRL-C ! mch_memmove(inbuf, inbuf + inbufcount, (size_t)(len)); inbufcount = 0; got_int = TRUE; } + --len; ++inbufcount; } } *** ../vim-8.2.3891/src/version.c 2021-12-25 11:20:00.237496694 +0000 --- src/version.c 2021-12-25 14:57:54.213822483 +0000 *************** *** 751,752 **** --- 751,754 ---- { /* Add new patch number below this line */ + /**/ + 3892, /**/ -- hundred-and-one symptoms of being an internet addict: 103. When you find yourself in the "Computer" section of Barnes & Noble enjoying yourself. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///