patch 9.1.1084: Unable to persistently ignore events in a window and its buffers

Problem:  Unable to persistently ignore events in a window and its buffers.
Solution: Add 'eventignorewin' option to ignore events in a window and buffer
          (Luuk van Baal)

Add the window-local 'eventignorewin' option that is analogous to
'eventignore', but applies to a certain window and its buffers. Identify
events that should be allowed in 'eventignorewin', adapt "auto_event"
and "event_tab" to encode this information. Window context is not passed
onto apply_autocmds_group(), and when to ignore an event is a bit
ambiguous when "buf" is not "curbuf", rather than a large refactor, only
ignore an event when all windows into "buf" are ignoring the event.

closes: #16530

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Luuk van Baal
2025-02-08 18:52:39 +01:00
committed by Christian Brabandt
parent a35040f795
commit b7147f8236
21 changed files with 287 additions and 191 deletions

View File

@ -164,6 +164,7 @@
#ifdef FEAT_DIFF
# define PV_DIFF OPT_WIN(WV_DIFF)
#endif
# define PV_EIW OPT_WIN(WV_EIW)
#ifdef FEAT_FOLDING
# define PV_FDC OPT_WIN(WV_FDC)
# define PV_FEN OPT_WIN(WV_FEN)
@ -917,6 +918,9 @@ static struct vimoption options[] =
{"eventignore", "ei", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
(char_u *)&p_ei, PV_NONE, did_set_eventignore, expand_set_eventignore,
{(char_u *)"", (char_u *)0L} SCTX_INIT},
{"eventignorewin", "eiw", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
(char_u *)VAR_WIN, PV_EIW, did_set_eventignore, expand_set_eventignore,
{(char_u *)"", (char_u *)0L} SCTX_INIT},
{"expandtab", "et", P_BOOL|P_VI_DEF|P_VIM,
(char_u *)&p_et, PV_ET, NULL, NULL,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},