Skip to content

Commit f655248

Browse files
authored
Merge pull request #13 from gw31415/master
Use built-in expand() without check when fern.vim is not loaded.
2 parents 5989a1a + c3dbeb9 commit f655248

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugin/fern_hijack.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ function! s:suppress_netrw() abort
1919
endif
2020
endfunction
2121

22+
" Called every BufEnter, but checks if fern#util#expand exists, thus preventing unnecessary load of fern.vim.
2223
function! s:expand(expr) abort
23-
try
24+
if exists('fern#util#expand')
2425
return fern#util#expand(a:expr)
25-
catch /^Vim\%((\a\+)\)\=:E117:/
26-
return expand(a:expr)
27-
endtry
26+
endif
27+
return expand(a:expr)
2828
endfunction
2929

3030
augroup fern-hijack

0 commit comments

Comments
 (0)