aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/aucmd.c
diff options
context:
space:
mode:
authorMagnus Groß <magnus.gross@rwth-aachen.de>2021-11-17 17:55:49 +0100
committerMagnus Groß <magnus.gross@rwth-aachen.de>2021-11-18 14:23:33 +0100
commit1fb101afe4f28ada83721c4ac260de46d23504ee (patch)
treea4aa3a2f24cd51f6b53fea0b15400bce0bf06f7f /src/nvim/aucmd.c
parentfdfd1eda434b70b02b4cb804546c97ef8ff09049 (diff)
downloadrneovim-1fb101afe4f28ada83721c4ac260de46d23504ee.tar.gz
rneovim-1fb101afe4f28ada83721c4ac260de46d23504ee.tar.bz2
rneovim-1fb101afe4f28ada83721c4ac260de46d23504ee.zip
vim-patch:8.2.3609: internal error when ModeChanged is triggered recursively
Problem: Internal error when ModeChanged is triggered when v:event is already in use. Solution: Save and restore v:event if needed. https://github.com/vim/vim/commit/3075a45592fe76f2febb6321632a23e352efe949 In the vim codebase there is no occurrence of get_vim_var_dict(VV_EVENT) after the above patch, so in order to hold the same invariant in the neovim codebase we needed to replace more occurrences than the related vim patch.
Diffstat (limited to 'src/nvim/aucmd.c')
-rw-r--r--src/nvim/aucmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/aucmd.c b/src/nvim/aucmd.c
index af519dcba9..a236b47027 100644
--- a/src/nvim/aucmd.c
+++ b/src/nvim/aucmd.c
@@ -8,6 +8,7 @@
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
#include "nvim/main.h"
+#include "nvim/misc1.h"
#include "nvim/os/os.h"
#include "nvim/ui.h"
#include "nvim/vim.h"
@@ -25,13 +26,14 @@ void do_autocmd_uienter(uint64_t chanid, bool attached)
}
recursive = true;
- dict_T *dict = get_vim_var_dict(VV_EVENT);
+ save_v_event_T save_v_event;
+ dict_T *dict = get_v_event(&save_v_event);
assert(chanid < VARNUMBER_MAX);
tv_dict_add_nr(dict, S_LEN("chan"), (varnumber_T)chanid);
tv_dict_set_keys_readonly(dict);
apply_autocmds(attached ? EVENT_UIENTER : EVENT_UILEAVE,
NULL, NULL, false, curbuf);
- tv_dict_clear(dict);
+ restore_v_event(dict, &save_v_event);
recursive = false;
}