aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/state.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-19 07:05:54 +0800
committerGitHub <noreply@github.com>2022-10-19 07:05:54 +0800
commit22473672aa1ce005d3841d0838a21cd6c6b721f7 (patch)
treec6508f32e1df04f9b2997a96a8b9134a0b0b27a0 /src/nvim/state.c
parenta5a5e273233ec6738fa6cda2a6618009646c4c47 (diff)
downloadrneovim-22473672aa1ce005d3841d0838a21cd6c6b721f7.tar.gz
rneovim-22473672aa1ce005d3841d0838a21cd6c6b721f7.tar.bz2
rneovim-22473672aa1ce005d3841d0838a21cd6c6b721f7.zip
vim-patch:9.0.0788: ModeChanged autocmd not executed when Visual ends with CTRL-C (#20722)
Problem: ModeChanged autocmd not executed when Visual mode is ended with CTRL-C. Solution: Do not trigger the autocmd when got_int is set. (closes vim/vim#11394) https://github.com/vim/vim/commit/61c4b04799bf114cadc3bbf212ae8b2ad22a6980 Cherry-pick removal of cmdwin feature check from patch 9.0.0663.
Diffstat (limited to 'src/nvim/state.c')
-rw-r--r--src/nvim/state.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/state.c b/src/nvim/state.c
index 7712fcd39a..460a9dd637 100644
--- a/src/nvim/state.c
+++ b/src/nvim/state.c
@@ -229,7 +229,9 @@ void get_mode(char *buf)
/// Fires a ModeChanged autocmd if appropriate.
void may_trigger_modechanged(void)
{
- if (!has_event(EVENT_MODECHANGED)) {
+ // Skip this when got_int is set, the autocommand will not be executed.
+ // Better trigger it next time.
+ if (!has_event(EVENT_MODECHANGED) || got_int) {
return;
}