From 7df207b67cc49aacf8d6ea33e4e8444e967b878d Mon Sep 17 00:00:00 2001 From: Nathan Lanza Date: Tue, 12 Aug 2025 13:39:36 -0400 Subject: [PATCH] Guard against invalid filenames in filter_oldfiles_unsafe Some plugins insert files into v:oldfiles with strange paths such as '[ Some message ]'. Startify errors on attempting to handle this path and creates a buggy vim startup experience. --- autoload/startify.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/autoload/startify.vim b/autoload/startify.vim index 3b9867a..3700397 100644 --- a/autoload/startify.vim +++ b/autoload/startify.vim @@ -659,7 +659,14 @@ function! s:filter_oldfiles_unsafe(path_prefix, path_format, use_env) abort continue endif - let absolute_path = glob(fnamemodify(fname, ":p")) + + " some plugins insert files into v:oldfiles with strange paths such as + " '[ Some message ]' and startify errors on attempting to handle them here. + try + let absolute_path = glob(fnamemodify(fname, ":p")) + catch /^Vim\%((\a\+)\)\=:E944:/ + let absolute_path = "" + endtry if empty(absolute_path) \ || has_key(entries, absolute_path) \ || (absolute_path =~ is_dir)