Explorar o código

Fix pathname display on Windows

glob(fname) forces `fname` to abide by the 'shellslash' setting

fnamemodify(..., ':p:~') will shorten pathnames to '~/...' if possible
ZeroKnight %!s(int64=11) %!d(string=hai) anos
pai
achega
678df1e12c
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      autoload/startify.vim

+ 2 - 2
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 <buffer>' index ':edit' fnameescape(fname) '<bar> call <sid>check_user_options()<cr>'
@@ -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 <buffer>' index ':edit' fnameescape(fname) '<bar> call <sid>check_user_options()<cr>'