Skip to content

Commit 5403555

Browse files
authored
Merge pull request #405 from ydzhou/universal
Create universal fern tree
2 parents 63b79ab + cc86a09 commit 5403555

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

autoload/fern.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ call s:Config.config(expand('<sfile>:p'), {
3636
\ 'disable_drawer_auto_resize': 0,
3737
\ 'disable_drawer_smart_quit': get(g:, 'disable_drawer_auto_quit', 0),
3838
\ 'disable_drawer_hover_popup': 0,
39+
\ 'disable_drawer_tabpage_isolation': 0,
3940
\ 'disable_drawer_auto_restore_focus': 0,
4041
\ 'default_hidden': 0,
4142
\ 'default_include': '',

autoload/fern/internal/command/fern.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ function! fern#internal#command#fern#command(mods, fargs) abort
7171
\ ? printf('drawer-right:%d', tabpagenr())
7272
\ : printf('drawer:%d', tabpagenr())
7373
\ : ''
74+
if drawer && g:fern#disable_drawer_tabpage_isolation
75+
let fri.authority = right ? 'drawer-right:0' : 'drawer:0'
76+
endif
7477
let fri.query = extend(fri.query, {
7578
\ 'width': width,
7679
\ 'keep': keep,

autoload/fern/internal/viewer/auto_duplication.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
function! fern#internal#viewer#auto_duplication#init() abort
2-
if g:fern#disable_viewer_auto_duplication
2+
if g:fern#disable_viewer_auto_duplication ||
3+
\ (g:fern#disable_drawer_tabpage_isolation && fern#internal#drawer#is_drawer())
34
return
45
endif
56

doc/fern.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,14 @@ VARIABLE *fern-variable*
421421

422422
Default: 0
423423

424+
*g:fern#disable_drawer_tabpage_isolation*
425+
Set 1 to disable the drawer tabpage isolation.
426+
427+
If disabled, there is only one left or right drawer across the all the
428+
windows and tabs for a given VIM instance.
429+
430+
Default: 0
431+
424432
*g:fern#disable_drawer_smart_quit*
425433
Set 1 to disable smart quit behavior when there are only two buffer
426434
remains (one is for the drawer styled fern window.)

0 commit comments

Comments
 (0)