Fix pathname display on Windows
glob(fname) forces `fname` to abide by the 'shellslash' setting fnamemodify(..., ':p:~') will shorten pathnames to '~/...' if possible
This commit is contained in:
parent
2872ab750b
commit
678df1e12c
|
@ -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>'
|
||||
|
|
Loading…
Reference in a new issue