[Files] Port junegunn/fzf/pull/1043 (#442)

This commit is contained in:
Jan Edmund Lazo
2017-09-06 22:03:56 -04:00
committed by Junegunn Choi
parent e7928d154a
commit 2fd046fa76

View File

@@ -263,7 +263,10 @@ endfunction
" Files " Files
" ------------------------------------------------------------------ " ------------------------------------------------------------------
function! s:shortpath() function! s:shortpath()
let short = pathshorten(fnamemodify(getcwd(), ':~:.')) let short = fnamemodify(getcwd(), ':~:.')
if !has('win32unix')
let short = pathshorten(short)
endif
let slash = (s:is_win && !&shellslash) ? '\' : '/' let slash = (s:is_win && !&shellslash) ? '\' : '/'
return empty(short) ? '~'.slash : short . (short =~ escape(slash, '\').'$' ? '' : slash) return empty(short) ? '~'.slash : short . (short =~ escape(slash, '\').'$' ? '' : slash)
endfunction endfunction