Commit 066dd1f
committed
Fix MacVim Ctrl-C handling in Normal and Command-Line modes
Vim has a "ctrl_c_interrupts" mode that gets turned on in misc modes
(e.g. Normal / Command-Line mode) when <C-C> is not mapped. In this
mode, Ctrl-C has special behavior and is hard-coded (i.e. not
remappable).
There is an old bug in how MacVim handles Ctrl-C under this mode. It's
trying to be smart and aggressively clears the input queue (even
non-text-related ones) without adding anything to the input queue.
Previously it kind of worked due to a coincidence in how Vim's GUI
handled input logic, but it was fragile. The recent Vim refactor that
changed Vim GUI's input handling broke this.
Instead, don't do any of these smart input queue clearing and just do
what Vim GUI code in other platforms does and call `trash_input_buf()`,
set `set_int`, and then add the Ctrl-C to the input queue. MacVim still
has `Cmd-.` for an aggressive interrupt in case Vim is hung (which
shouldn't happen to begin with).
Fix #8461 parent 1c34fb4 commit 066dd1f
1 file changed
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1270 | 1270 | | |
1271 | 1271 | | |
1272 | 1272 | | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
1277 | 1282 | | |
1278 | 1283 | | |
1279 | | - | |
1280 | | - | |
| 1284 | + | |
1281 | 1285 | | |
1282 | | - | |
1283 | | - | |
1284 | 1286 | | |
1285 | 1287 | | |
1286 | 1288 | | |
| |||
0 commit comments