From 82a215cb2dc2b80c1b8bc455c90a928b636d8b3a Mon Sep 17 00:00:00 2001 From: luukvbaal Date: Wed, 12 Feb 2025 11:01:06 +0100 Subject: 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. https://github.com/vim/vim/commit/b7147f8236c962cd74d1ce028d9106f1c449ea6c 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 https://github.com/vim/vim/commit/bfc7719e48ffc365ee0a1bd1888120d26b6365f0 --- runtime/lua/vim/_meta/options.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 9bf183a1c1..cd014978b0 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -1989,6 +1989,16 @@ vim.o.ei = vim.o.eventignore vim.go.eventignore = vim.o.eventignore vim.go.ei = vim.go.eventignore +--- Similar to 'eventignore' but applies to a particular window and its +--- buffers, for which window and buffer related autocommands can be +--- ignored indefinitely without affecting the global 'eventignore'. +--- +--- @type string +vim.o.eventignorewin = "" +vim.o.eiw = vim.o.eventignorewin +vim.wo.eventignorewin = vim.o.eventignorewin +vim.wo.eiw = vim.wo.eventignorewin + --- In Insert mode: Use the appropriate number of spaces to insert a --- . Spaces are used in indents with the '>' and '<' commands and --- when 'autoindent' is on. To insert a real tab when 'expandtab' is -- cgit