Skip to content

Commit 23dc077

Browse files
authored
Merge pull request #437 from lambdalisue/fix-432
Do NOT save winwidth on some situation to fix #432
2 parents 4a319ff + b43fefd commit 23dc077

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

autoload/fern/internal/drawer/auto_resize.vim

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,20 @@ function! fern#internal#drawer#auto_resize#init() abort
1818
endif
1919
endfunction
2020

21+
function! s:count_others() abort
22+
let bufnr = bufnr('%')
23+
let bufnrs = map(range(0, winnr('$')), { -> winbufnr(v:val) })
24+
call filter(bufnrs, { -> bufnr isnot# v:val })
25+
return len(bufnrs)
26+
endfunction
27+
2128
if has('nvim')
2229
function! s:should_ignore() abort
23-
return nvim_win_get_config(win_getid()).relative !=# ''
30+
return nvim_win_get_config(win_getid()).relative !=# '' || s:count_others() is# 0
2431
endfunction
2532
else
2633
function! s:should_ignore() abort
27-
return 0
34+
return s:count_others() is# 0
2835
endfunction
2936
endif
3037

0 commit comments

Comments
 (0)