From 678df1e12c458780c7c786b841ac3272a827d199 Mon Sep 17 00:00:00 2001 From: ZeroKnight Date: Thu, 24 Apr 2014 01:22:34 -0400 Subject: [PATCH] Fix pathname display on Windows glob(fname) forces `fname` to abide by the 'shellslash' setting fnamemodify(..., ':p:~') will shorten pathnames to '~/...' if possible --- autoload/startify.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/startify.vim b/autoload/startify.vim index 239d6f0..e5db03b 100644 --- a/autoload/startify.vim +++ b/autoload/startify.vim @@ -292,7 +292,7 @@ function! s:show_dir(cnt) abort let entries[fullpath] = 1 let index = s:get_index_as_string(cnt) - let display_fname = s:relative_path ? fnamemodify(fname, ':.') : fname + let display_fname = s:relative_path ? fnamemodify(glob(fname), ':.') : fnamemodify(glob(fname), ':p:~') call append('$', ' ['. index .']'. repeat(' ', (3 - strlen(index))) . display_fname) execute 'nnoremap ' index ':edit' fnameescape(fname) ' call check_user_options()' @@ -338,7 +338,7 @@ function! s:show_files(cnt) abort let entries[fullpath] = 1 let index = s:get_index_as_string(cnt) - let display_fname = s:relative_path ? fnamemodify(fname, ':.') : fname + let display_fname = s:relative_path ? fnamemodify(glob(fname), ':.') : fnamemodify(glob(fname), ':p:~') call append('$', ' ['. index .']'. repeat(' ', (3 - strlen(index))) . display_fname) execute 'nnoremap ' index ':edit' fnameescape(fname) ' call check_user_options()'