diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-10-29 17:28:24 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-10-30 13:10:29 +0100 |
commit | 7cd204dbfa9beb6e59c82d49b029704b9edd4cdb (patch) | |
tree | 033b1e0e8f1cd6efe9f66cc1033eb0b004e38fc2 /src | |
parent | 6143cfdeec4e67cdf73879b92fe2a80b5b36bc1b (diff) | |
download | rneovim-7cd204dbfa9beb6e59c82d49b029704b9edd4cdb.tar.gz rneovim-7cd204dbfa9beb6e59c82d49b029704b9edd4cdb.tar.bz2 rneovim-7cd204dbfa9beb6e59c82d49b029704b9edd4cdb.zip |
ex_global: Catch CTRL-C even if it is mapped.
Problem: If CTRL-C is mapped, it does not interrupt :global output.
Solution: clear `mapped_ctrl_c` during :global.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_cmds.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 17780c58e4..d616b55554 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -4082,6 +4082,7 @@ void global_exe(char_u *cmd) linenr_T old_lcount; /* b_ml.ml_line_count before the command */ buf_T *old_buf = curbuf; /* remember what buffer we started in */ linenr_T lnum; /* line number according to old situation */ + int save_mapped_ctrl_c = mapped_ctrl_c; /* * Set current position only once for a global command. @@ -4092,6 +4093,8 @@ void global_exe(char_u *cmd) /* When the command writes a message, don't overwrite the command. */ msg_didout = TRUE; + // Disable CTRL-C mapping, let it interrupt (potentially long output). + mapped_ctrl_c = 0; sub_nsubs = 0; sub_nlines = 0; @@ -4108,6 +4111,7 @@ void global_exe(char_u *cmd) os_breakcheck(); } + mapped_ctrl_c = save_mapped_ctrl_c; global_busy = 0; if (global_need_beginline) beginline(BL_WHITE | BL_FIX); |