From 4f9694b8abbd10b89532570924fd1ba57db105fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=9Blisue?= Date: Mon, 6 Jan 2025 21:45:29 +0900 Subject: [PATCH] Automatically restore `winfixwidth` when leaving the buffer (#517) --- autoload/fern/internal/drawer/auto_winfixwidth.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/autoload/fern/internal/drawer/auto_winfixwidth.vim b/autoload/fern/internal/drawer/auto_winfixwidth.vim index 06a26f0..fb53faf 100644 --- a/autoload/fern/internal/drawer/auto_winfixwidth.vim +++ b/autoload/fern/internal/drawer/auto_winfixwidth.vim @@ -6,9 +6,14 @@ function! fern#internal#drawer#auto_winfixwidth#init() abort augroup fern_internal_drawer_auto_winfixwidth_init autocmd! * autocmd BufEnter call s:set_winfixwidth() + autocmd BufWinLeave call s:restore_winfixwidth() augroup END endfunction function! s:set_winfixwidth() abort let &l:winfixwidth = winnr('$') isnot# 1 endfunction + +function! s:restore_winfixwidth() abort + let &l:winfixwidth = 0 +endfunction