commit b92e3889fef2df4356ab699503795992fab2f75d
parent 4b2c2eb1205730cdfdb85df77c6415a1715f1bc1
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon, 16 Jun 2025 10:14:20 +0800
vim-patch:631a50c: runtime(doc): mention cannot ignored events in eventignorewin (#34522)
closes: vim/vim#17545
https://github.com/vim/vim/commit/631a50ceb9a312a9042a8e8420afd8e948497d90
Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat:
5 files changed, 170 insertions(+), 1 deletion(-)
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
@@ -2435,6 +2435,79 @@ A jump table for the options with a short description can be found at |Q_op|.
buffers, for which window and buffer related autocommands can be
ignored indefinitely without affecting the global 'eventignore'.
+ Note: The following events are considered to happen outside of a
+ window context and thus cannot be ignored by 'eventignorewin':
+
+ |ChanInfo|,
+ |ChanOpen|,
+ |CmdUndefined|,
+ |CmdlineChanged|,
+ |CmdlineEnter|,
+ |CmdlineLeave|,
+ |CmdlineLeavePre|,
+ |CmdwinEnter|,
+ |CmdwinLeave|,
+ |ColorScheme|,
+ |ColorSchemePre|,
+ |CompleteChanged|,
+ |CompleteDone|,
+ |CompleteDonePre|,
+ |DiagnosticChanged|,
+ |DiffUpdated|,
+ |DirChanged|,
+ |DirChangedPre|,
+ |ExitPre|,
+ |FocusGained|,
+ |FocusLost|,
+ |FuncUndefined|,
+ |LspAttach|,
+ |LspDetach|,
+ |LspNotify|,
+ |LspProgress|,
+ |LspRequest|,
+ |LspTokenUpdate|,
+ |MenuPopup|,
+ |ModeChanged|,
+ |OptionSet|,
+ |QuickFixCmdPost|,
+ |QuickFixCmdPre|,
+ |QuitPre|,
+ |RemoteReply|,
+ |SafeState|,
+ |SessionLoadPost|,
+ |SessionWritePost|,
+ |ShellCmdPost|,
+ |Signal|,
+ |SourceCmd|,
+ |SourcePost|,
+ |SourcePre|,
+ |SpellFileMissing|,
+ |StdinReadPost|,
+ |StdinReadPre|,
+ |SwapExists|,
+ |Syntax|,
+ |TabClosed|,
+ |TabEnter|,
+ |TabLeave|,
+ |TabNew|,
+ |TabNewEntered|,
+ |TermClose|,
+ |TermEnter|,
+ |TermLeave|,
+ |TermOpen|,
+ |TermRequest|,
+ |TermResponse|,
+ |UIEnter|,
+ |UILeave|,
+ |User|,
+ |VimEnter|,
+ |VimLeave|,
+ |VimLeavePre|,
+ |VimResized|,
+ |VimResume|,
+ |VimSuspend|,
+ |WinNew|
+
*'expandtab'* *'et'* *'noexpandtab'* *'noet'*
'expandtab' 'et' boolean (default off)
local to buffer
diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua
@@ -2096,6 +2096,79 @@ vim.go.ei = vim.go.eventignore
--- buffers, for which window and buffer related autocommands can be
--- ignored indefinitely without affecting the global 'eventignore'.
---
+--- Note: The following events are considered to happen outside of a
+--- window context and thus cannot be ignored by 'eventignorewin':
+---
+--- `ChanInfo`,
+--- `ChanOpen`,
+--- `CmdUndefined`,
+--- `CmdlineChanged`,
+--- `CmdlineEnter`,
+--- `CmdlineLeave`,
+--- `CmdlineLeavePre`,
+--- `CmdwinEnter`,
+--- `CmdwinLeave`,
+--- `ColorScheme`,
+--- `ColorSchemePre`,
+--- `CompleteChanged`,
+--- `CompleteDone`,
+--- `CompleteDonePre`,
+--- `DiagnosticChanged`,
+--- `DiffUpdated`,
+--- `DirChanged`,
+--- `DirChangedPre`,
+--- `ExitPre`,
+--- `FocusGained`,
+--- `FocusLost`,
+--- `FuncUndefined`,
+--- `LspAttach`,
+--- `LspDetach`,
+--- `LspNotify`,
+--- `LspProgress`,
+--- `LspRequest`,
+--- `LspTokenUpdate`,
+--- `MenuPopup`,
+--- `ModeChanged`,
+--- `OptionSet`,
+--- `QuickFixCmdPost`,
+--- `QuickFixCmdPre`,
+--- `QuitPre`,
+--- `RemoteReply`,
+--- `SafeState`,
+--- `SessionLoadPost`,
+--- `SessionWritePost`,
+--- `ShellCmdPost`,
+--- `Signal`,
+--- `SourceCmd`,
+--- `SourcePost`,
+--- `SourcePre`,
+--- `SpellFileMissing`,
+--- `StdinReadPost`,
+--- `StdinReadPre`,
+--- `SwapExists`,
+--- `Syntax`,
+--- `TabClosed`,
+--- `TabEnter`,
+--- `TabLeave`,
+--- `TabNew`,
+--- `TabNewEntered`,
+--- `TermClose`,
+--- `TermEnter`,
+--- `TermLeave`,
+--- `TermOpen`,
+--- `TermRequest`,
+--- `TermResponse`,
+--- `UIEnter`,
+--- `UILeave`,
+--- `User`,
+--- `VimEnter`,
+--- `VimLeave`,
+--- `VimLeavePre`,
+--- `VimResized`,
+--- `VimResume`,
+--- `VimSuspend`,
+--- `WinNew`
+---
--- @type string
vim.o.eventignorewin = ""
vim.o.eiw = vim.o.eventignorewin
diff --git a/src/gen/gen_eval_files.lua b/src/gen/gen_eval_files.lua
@@ -6,6 +6,7 @@ local util = require('gen.util')
local fmt = string.format
local DEP_API_METADATA = arg[1]
+local TAGS_FILE = arg[2]
local TEXT_WIDTH = 78
--- @class vim.api.metadata
@@ -797,6 +798,23 @@ local function get_option_meta()
end
local r = vim.deepcopy(o) --[[@as vim.option_meta]]
r.desc = o.desc:gsub('^ ', ''):gsub('\n ', '\n')
+ if o.full_name == 'eventignorewin' then
+ local events = require('nvim.auevents').events
+ local tags_file = assert(io.open(TAGS_FILE))
+ local tags_text = tags_file:read('*a')
+ tags_file:close()
+ local map_fn = function(k, v)
+ if v then
+ return nil
+ end
+ local tag_pat = ('\n%s\t([^\t]+)\t'):format(k)
+ local link_text = ('|%s|'):format(k)
+ local tags_match = tags_text:match(tag_pat) --- @type string?
+ return tags_match and tags_match ~= 'deprecated.txt' and link_text or nil
+ end
+ local extra_desc = vim.iter(vim.spairs(events)):map(map_fn):join(',\n\t')
+ r.desc = r.desc:gsub('<PLACEHOLDER>', extra_desc)
+ end
r.defaults = r.defaults or {}
if r.defaults.meta == nil then
r.defaults.meta = optinfo[o.full_name].default
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
@@ -973,7 +973,7 @@ add_target(doc-vim
)
add_target(doc-eval
- COMMAND ${NVIM_LUA} ${PROJECT_SOURCE_DIR}/src/gen/gen_eval_files.lua ${FUNCS_METADATA}
+ COMMAND ${NVIM_LUA} ${PROJECT_SOURCE_DIR}/src/gen/gen_eval_files.lua ${FUNCS_METADATA} ${PROJECT_BINARY_DIR}/runtime/doc/tags
DEPENDS
nvim
${FUNCS_METADATA}
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
@@ -2752,6 +2752,11 @@ local options = {
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'.
+
+ Note: The following events are considered to happen outside of a
+ window context and thus cannot be ignored by 'eventignorewin':
+
+ <PLACEHOLDER>
]=],
expand_cb = 'expand_set_eventignore',
full_name = 'eventignorewin',