feat(options): add 'eventignorewin' (#32152)

vim-patch:partial: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.

b7147f8236

vim-patch:9.1.1102: tests: Test_WinScrolled_Resized_eiw() uses wrong filename

Problem:  tests: Test_WinScrolled_Resized_eiw() uses wrong filename
          (Luuk van Baal, after v9.1.1084)
Solution: Rename the filename to something more unique

bfc7719e48
This commit is contained in:
luukvbaal
2025-02-12 11:01:06 +01:00
committed by GitHub
parent 6982106f8c
commit 82a215cb2d
19 changed files with 406 additions and 259 deletions

View File

@@ -1082,27 +1082,32 @@ int expand_set_encoding(optexpand_T *args, int *numMatches, char ***matches)
return expand_set_opt_generic(args, get_encoding_name, numMatches, matches);
}
/// The 'eventignore' option is changed.
const char *did_set_eventignore(optset_T *args FUNC_ATTR_UNUSED)
/// The 'eventignore(win)' option is changed.
const char *did_set_eventignore(optset_T *args)
{
if (check_ei() == FAIL) {
char **varp = (char **)args->os_varp;
if (check_ei(*varp) == FAIL) {
return e_invarg;
}
return NULL;
}
static bool expand_eiw = false;
static char *get_eventignore_name(expand_T *xp, int idx)
{
// 'eventignore' allows special keyword "all" in addition to
// 'eventignore(win)' allows special keyword "all" in addition to
// all event names.
if (idx == 0) {
return "all";
}
return get_event_name_no_group(xp, idx - 1);
return get_event_name_no_group(xp, idx - 1, expand_eiw);
}
int expand_set_eventignore(optexpand_T *args, int *numMatches, char ***matches)
{
expand_eiw = args->oe_varp != (char *)&p_ei;
return expand_set_opt_generic(args, get_eventignore_name, numMatches, matches);
}