Steps to reproduce
Start Vim:
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:
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
Steps to reproduce
Start Vim:
Then run:
Actual behaviour
The current window has an empty
colorcolumn, but the other window still hascolorcolumn=73:Expected behaviour
Both windows should stop showing the filetype-specific color column when their shared buffer changes filetype. Generally,
:help undo_ftpluginsays 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