Skip to content

Commit 5ca487d

Browse files
committed
Revert "lazy-load fern"
This reverts commit 31e0689.
1 parent 31e0689 commit 5ca487d

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

plugin/fern_hijack.vim

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ if exists('g:loaded_fern_hijack') || ( !has('nvim') && v:version < 801 )
33
endif
44
let g:loaded_fern_hijack = 1
55

6-
function! s:hijack_directory(path) abort
7-
if !isdirectory(a:path)
6+
function! s:hijack_directory() abort
7+
let path = s:expand('%:p')
8+
if !isdirectory(path)
89
return
910
endif
1011
let bufnr = bufnr()
11-
execute printf('keepjumps keepalt Fern %s', fnameescape(a:path))
12+
execute printf('keepjumps keepalt Fern %s', fnameescape(path))
1213
execute printf('silent! bwipeout %d', bufnr)
1314
endfunction
1415

@@ -26,13 +27,8 @@ function! s:expand(expr) abort
2627
endtry
2728
endfunction
2829

29-
function! s:initial_hijack() abort
30-
call s:hijack_directory(expand('%:p'))
31-
autocmd fern-hijack BufEnter * ++nested call s:hijack_directory(s:expand('%:p'))
32-
endfunction
33-
3430
augroup fern-hijack
3531
autocmd!
3632
autocmd VimEnter * call s:suppress_netrw()
37-
autocmd BufEnter * ++once ++nested call s:initial_hijack()
33+
autocmd BufEnter * ++nested call s:hijack_directory()
3834
augroup END

0 commit comments

Comments
 (0)