Mercurial > vim
comparison src/ui.c @ 19730:fe8ba2f82f59 v8.2.0421
patch 8.2.0421: interrupting with CTRL-C does not always work
Commit: https://github.com/vim/vim/commit/9645e2d9fc8a591f1db30383caccf71d40e0810c
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Mar 20 20:48:49 2020 +0100
patch 8.2.0421: interrupting with CTRL-C does not always work
Problem: Interrupting with CTRL-C does not always work.
Solution: Recognize CTRL-C while modifyOtherKeys is set.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 20 Mar 2020 21:00:05 +0100 |
parents | 2ef19eed524a |
children | 0208534b8a84 |
comparison
equal
deleted
inserted
replaced
19729:bc91817dda84 | 19730:fe8ba2f82f59 |
---|---|
2278 | 2278 |
2279 len = 0; // to avoid gcc warning | 2279 len = 0; // to avoid gcc warning |
2280 for (try = 0; try < 100; ++try) | 2280 for (try = 0; try < 100; ++try) |
2281 { | 2281 { |
2282 size_t readlen = (size_t)((INBUFLEN - inbufcount) | 2282 size_t readlen = (size_t)((INBUFLEN - inbufcount) |
2283 / input_conv.vc_factor); | 2283 / input_conv.vc_factor); |
2284 # ifdef VMS | 2284 # ifdef VMS |
2285 len = vms_read((char *)inbuf + inbufcount, readlen); | 2285 len = vms_read((char *)inbuf + inbufcount, readlen); |
2286 # else | 2286 # else |
2287 len = read(read_cmd_fd, (char *)inbuf + inbufcount, readlen); | 2287 len = read(read_cmd_fd, (char *)inbuf + inbufcount, readlen); |
2288 # endif | 2288 # endif |
2342 rest == NULL ? &rest : NULL, &restlen); | 2342 rest == NULL ? &rest : NULL, &restlen); |
2343 } | 2343 } |
2344 while (len-- > 0) | 2344 while (len-- > 0) |
2345 { | 2345 { |
2346 /* | 2346 /* |
2347 * if a CTRL-C was typed, remove it from the buffer and set got_int | 2347 * If a CTRL-C was typed, remove it from the buffer and set |
2348 * got_int. Also recognize CTRL-C with modifyOtherKeys set. | |
2348 */ | 2349 */ |
2349 if (inbuf[inbufcount] == 3 && ctrl_c_interrupts) | 2350 if (ctrl_c_interrupts && (inbuf[inbufcount] == 3 |
2351 || (len >= 9 && STRNCMP(inbuf + inbufcount, | |
2352 "\e[27;5;99~", 10) == 0))) | |
2350 { | 2353 { |
2351 // remove everything typed before the CTRL-C | 2354 // remove everything typed before the CTRL-C |
2352 mch_memmove(inbuf, inbuf + inbufcount, (size_t)(len + 1)); | 2355 mch_memmove(inbuf, inbuf + inbufcount, (size_t)(len + 1)); |
2353 inbufcount = 0; | 2356 inbufcount = 0; |
2354 got_int = TRUE; | 2357 got_int = TRUE; |