[vim/vim] `b:undo_ftplugin` cannot undo window-local options in every window showing a buffer (Issue #21243)

2 views
Skip to first unread message

Barrett Ruth

unread,
Sep 7, 2026, 5:55:39 AM (3 days ago) Sep 7
to vim/vim, Subscribed
barrettruth created an issue (vim/vim#21243)

Steps to reproduce

Start Vim:

vim --clean

Then run:

:filetype plugin on
:setglobal colorcolumn=
:set filetype=fixture
:setlocal colorcolumn=73
:let b:undo_ftplugin = 'setlocal colorcolumn<'
:split
:set filetype=text
:windo echo win_getid() (empty(&l:colorcolumn) ? '<empty>' : &l:colorcolumn)
:messages

Actual behaviour

The current window has an empty colorcolumn, but the other window still has colorcolumn=73:

1001 <empty>
1000 73

Expected behaviour

Both windows should stop showing the filetype-specific color column when their shared buffer changes filetype. Generally, :help undo_ftplugin says that "the effect of the previous filetype should be undone" - and this isn't really true.

Obviously, we know that a buffer-scoped undo hook cannot fully undo window-local effects when the buffer is displayed in multiple windows. Just wanted to canonicalize this issue here as I found it today.

Note that this is distinct from #17113.

Version of Vim

9.1.1752

Environment

macOS arm64 + nix


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/21243@github.com>

Reply all
Reply to author
Forward
0 new messages