Skip to content

Commit

Permalink
Merge pull request #405 from ydzhou/universal
Browse files Browse the repository at this point in the history
Create universal fern tree
  • Loading branch information
lambdalisue authored Mar 21, 2022
2 parents 63b79ab + cc86a09 commit 5403555
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions autoload/fern.vim
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ call s:Config.config(expand('<sfile>:p'), {
\ 'disable_drawer_auto_resize': 0,
\ 'disable_drawer_smart_quit': get(g:, 'disable_drawer_auto_quit', 0),
\ 'disable_drawer_hover_popup': 0,
\ 'disable_drawer_tabpage_isolation': 0,
\ 'disable_drawer_auto_restore_focus': 0,
\ 'default_hidden': 0,
\ 'default_include': '',
Expand Down
3 changes: 3 additions & 0 deletions autoload/fern/internal/command/fern.vim
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ function! fern#internal#command#fern#command(mods, fargs) abort
\ ? printf('drawer-right:%d', tabpagenr())
\ : printf('drawer:%d', tabpagenr())
\ : ''
if drawer && g:fern#disable_drawer_tabpage_isolation
let fri.authority = right ? 'drawer-right:0' : 'drawer:0'
endif
let fri.query = extend(fri.query, {
\ 'width': width,
\ 'keep': keep,
Expand Down
3 changes: 2 additions & 1 deletion autoload/fern/internal/viewer/auto_duplication.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
function! fern#internal#viewer#auto_duplication#init() abort
if g:fern#disable_viewer_auto_duplication
if g:fern#disable_viewer_auto_duplication ||
\ (g:fern#disable_drawer_tabpage_isolation && fern#internal#drawer#is_drawer())
return
endif

Expand Down
8 changes: 8 additions & 0 deletions doc/fern.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,14 @@ VARIABLE *fern-variable*

Default: 0

*g:fern#disable_drawer_tabpage_isolation*
Set 1 to disable the drawer tabpage isolation.

If disabled, there is only one left or right drawer across the all the
windows and tabs for a given VIM instance.

Default: 0

*g:fern#disable_drawer_smart_quit*
Set 1 to disable smart quit behavior when there are only two buffer
remains (one is for the drawer styled fern window.)
Expand Down

0 comments on commit 5403555

Please sign in to comment.