diff --git a/plugin/vinegar.vim b/plugin/vinegar.vim index 660ee29..871e23b 100644 --- a/plugin/vinegar.vim +++ b/plugin/vinegar.vim @@ -54,8 +54,9 @@ function! s:opendir(cmd) abort elseif expand('%') =~# '^$\|^term:[\/][\/]' execute a:cmd '.' else + let currentFilename = expand('%:t') execute a:cmd '%:h' . (expand('%:p') =~# '^\a\a\+:' ? s:slash() : '') - call s:seek(expand('#:t')) + call s:seek(currentFilename) endif endfunction