From 558bb0582e82b00a8f9078e4dd47942b91fd78fa Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Wed, 29 Jan 2025 10:50:16 +0100 Subject: [PATCH] man.vim: Check if WinResized is supported WinResized was introduced rather recently with vim patch 9.0.0917 / neovim v0.9.0 via commit 4571ba4d0a52 ("vim-patch:partial:9.0.0917: the WinScrolled autocommand event is not enough (#21161)"). --- .config/vim/after/ftplugin/man.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/vim/after/ftplugin/man.vim b/.config/vim/after/ftplugin/man.vim index e592418..230aeb8 100644 --- a/.config/vim/after/ftplugin/man.vim +++ b/.config/vim/after/ftplugin/man.vim @@ -33,6 +33,9 @@ normal M " " This is very hacky. +" Only if WinResized is supported +if has('##WinResized') + augroup man_resized " The reload has to be delayed slightly, since with an `edit` directly in " the autocmd, the buffer will just be cleared? (TODO) @@ -65,4 +68,6 @@ endif " When wrapping is turned on, shrinking the window will momentarily rewrap the " lines, messing up the whole buffer. Since this is distracting, turn it off. setlocal nowrap + +endif " has('##WinResized') " ------------------------------------------------------------------------------