Skip to content

Commit 3006aa5

Browse files
committed
Automatically restore winfixwidth when leaving the buffer
Close #512
1 parent 56f7c0d commit 3006aa5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

autoload/fern/internal/drawer/auto_winfixwidth.vim

+5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ function! fern#internal#drawer#auto_winfixwidth#init() abort
66
augroup fern_internal_drawer_auto_winfixwidth_init
77
autocmd! * <buffer>
88
autocmd BufEnter <buffer> call s:set_winfixwidth()
9+
autocmd BufWinLeave <buffer> call s:restore_winfixwidth()
910
augroup END
1011
endfunction
1112

1213
function! s:set_winfixwidth() abort
1314
let &l:winfixwidth = winnr('$') isnot# 1
1415
endfunction
16+
17+
function! s:restore_winfixwidth() abort
18+
let &l:winfixwidth = 0
19+
endfunction

0 commit comments

Comments
 (0)