diff --git a/autoload/fern.vim b/autoload/fern.vim index 4e0ce4f..a734161 100644 --- a/autoload/fern.vim +++ b/autoload/fern.vim @@ -36,6 +36,7 @@ call s:Config.config(expand(':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': '', diff --git a/autoload/fern/internal/command/fern.vim b/autoload/fern/internal/command/fern.vim index 12f3eef..de486bc 100644 --- a/autoload/fern/internal/command/fern.vim +++ b/autoload/fern/internal/command/fern.vim @@ -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, diff --git a/autoload/fern/internal/viewer/auto_duplication.vim b/autoload/fern/internal/viewer/auto_duplication.vim index 4674158..0522ce5 100644 --- a/autoload/fern/internal/viewer/auto_duplication.vim +++ b/autoload/fern/internal/viewer/auto_duplication.vim @@ -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 diff --git a/doc/fern.txt b/doc/fern.txt index 7f98cfd..f598b2e 100644 --- a/doc/fern.txt +++ b/doc/fern.txt @@ -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.)