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)").
This commit is contained in:
2025-01-29 10:50:16 +01:00
parent 0c0231a2ef
commit 558bb0582e

View File

@@ -33,6 +33,9 @@ normal M
" "
" This is very hacky. " This is very hacky.
" Only if WinResized is supported
if has('##WinResized')
augroup man_resized augroup man_resized
" The reload has to be delayed slightly, since with an `edit` directly in " The reload has to be delayed slightly, since with an `edit` directly in
" the autocmd, the buffer will just be cleared? (TODO) " 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 " 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. " lines, messing up the whole buffer. Since this is distracting, turn it off.
setlocal nowrap setlocal nowrap
endif " has('##WinResized')
" ------------------------------------------------------------------------------ " ------------------------------------------------------------------------------