File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -3,21 +3,29 @@ if exists('g:loaded_fern_hijack') || ( !has('nvim') && v:version < 801 )
33endif
44let g: loaded_fern_hijack = 1
55
6- function ! s: suppress_netrw () abort
7- if exists (' #FileExplorer' )
8- autocmd ! FileExplorer *
9- endif
10- endfunction
11-
126function ! s: hijack_directory () abort
13- let path = expand (' %:p' )
7+ let path = s: expand (' %:p' )
148 if ! isdirectory (path )
159 return
1610 endif
1711 silent bwipeout %
1812 execute printf (' Fern %s' , fnameescape (path ))
1913endfunction
2014
15+ function ! s: suppress_netrw () abort
16+ if exists (' #FileExplorer' )
17+ autocmd ! FileExplorer *
18+ endif
19+ endfunction
20+
21+ function ! s: expand (expr ) abort
22+ try
23+ return fern#util#expand (a: expr )
24+ catch /^Vim\%((\a\+)\)\=:E117:/
25+ return expand (a: expr )
26+ endtry
27+ endfunction
28+
2129augroup fern - hijack
2230 autocmd !
2331 autocmd VimEnter * call s: suppress_netrw ()
You can’t perform that action at this time.
0 commit comments