Skip to content

Commit b940770

Browse files
committed
Automatically set nowinfixwidth to fix #416
1 parent 83c1d77 commit b940770

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

autoload/fern/internal/drawer/auto_winfixwidth.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ function! fern#internal#drawer#auto_winfixwidth#init() abort
55

66
augroup fern_internal_drawer_auto_winfixwidth_init
77
autocmd! * <buffer>
8-
autocmd BufEnter <buffer> setlocal winfixwidth
8+
autocmd BufEnter <buffer> call s:set_winfixwidth()
99
augroup END
1010
endfunction
11+
12+
function! s:set_winfixwidth() abort
13+
let &l:winfixwidth = winnr('$') isnot# 1
14+
endfunction

doc/fern.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,9 @@ VARIABLE *fern-variable*
401401

402402
*g:fern#disable_drawer_auto_winfixwidth*
403403
Set 1 to disable automatically enable 'winfixwidth' to drawer on
404-
|BufEnter| autocmd.
404+
|BufEnter| autocmd. Note that it automatically set 'nowinfixwidth' on
405+
the autocmd when there is only one window.
406+
405407
Default: 0
406408

407409
*g:fern#disable_drawer_auto_resize*

0 commit comments

Comments
 (0)