Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion autoload/startify.vim
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,18 @@ function! s:filter_oldfiles_unsafe(path_prefix, path_format, use_env) abort
" https://github.com/mhinz/vim-startify/issues/353
continue
endif

let fname = fnamemodify(fname, ":p")
if exists('+shellslash') && !&shellslash
" win32 paths can't contain '*' and '?'
" though DOS device paths can contain '?', they need not be escaped
" see https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats
let fname = substitute(fname, '\[', '\[[]', 'g')
else
let fname = substitute(fname, '[[\]*?\\]', '\\\0', 'g')
endif
let absolute_path = glob(fname)

let absolute_path = glob(fnamemodify(fname, ":p"))
if empty(absolute_path)
\ || has_key(entries, absolute_path)
\ || (absolute_path =~ is_dir)
Expand Down