]> git.ipfire.org Git - thirdparty/vim.git/commit
runtime(html): guard against an existing b:undo_ftplugin var
authorD. Ben Knoble <ben.knoble+github@gmail.com>
Sun, 14 Sep 2025 08:42:25 +0000 (04:42 -0400)
committerChristian Brabandt <cb@256bit.org>
Sun, 14 Sep 2025 08:42:25 +0000 (04:42 -0400)
commit81ca9916d2fb2675a1a6da22fd68d26fb0ee8b8e
tree7054ac60a6f483396e2a51eced616953edef48c7
parentc077f5e9d82189f5d1ce86068e10540139fec6cb
runtime(html): guard against an existing b:undo_ftplugin var

Filetype plugins should not assume they are the only file to execute on
behalf of a buffer's filetype: other filetypes may use them, and
dotted filetypes may cause multiple to run. When this occurs, they
should _build_ on their respective b:undo_ftplugin settings, not
overwrite each other.

For example, when using a dotted filetype wiki.markdown, the wiki
filetype plugins go first. Then, during the markdown filetype plugins,
the HTML plugin's unconditional assignment to b:undo_ftplugin trashes
any data previously stored there by the wiki filetype.

Follow the pattern elsewhere of assigning or appending conditionally.

closes: #18267

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/ftplugin/html.vim