Skip to content

Commit 5ba9ff3

Browse files
authored
BufEnter: relative path is sometimes empty on Windows #206
On Windows when the dirvish buffer for a directory does not exist yet, an empty string is passed to s:isdir and as a result, the dirvish buffer is empty
1 parent 9c0dc32 commit 5ba9ff3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugin/dirvish.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ augroup dirvish
1616
" Remove netrw and NERDTree directory handlers.
1717
autocmd VimEnter * if exists('#FileExplorer') | exe 'au! FileExplorer *' | endif
1818
autocmd VimEnter * if exists('#NERDTreeHijackNetrw') | exe 'au! NERDTreeHijackNetrw *' | endif
19-
autocmd BufEnter * if !exists('b:dirvish') && <SID>isdir(expand('%'))
20-
\ | exe 'Dirvish %'
19+
autocmd BufEnter * if !exists('b:dirvish') && <SID>isdir(expand('%:p'))
20+
\ | exe 'Dirvish %:p'
2121
\ | elseif exists('b:dirvish') && &buflisted && bufnr('$') > 1 | setlocal nobuflisted | endif
2222
autocmd FileType dirvish if exists('#fugitive') | call FugitiveDetect(@%) | endif
2323
autocmd ShellCmdPost * if exists('b:dirvish') | exe 'Dirvish %' | endif

0 commit comments

Comments
 (0)