[vim] Do not pathshorten prompt in cygwin (#1043)

Prevents the following case:
before pathshorten - /usr/bin
after pathshorten - /u/bin
piped to cmd.exe - U:/bin
This commit is contained in:
Jan Edmund Lazo 2017-09-06 22:03:26 -04:00 committed by Junegunn Choi
parent 5edc3f755c
commit 79d2ef4616

View File

@ -772,7 +772,10 @@ let s:default_action = {
\ 'ctrl-v': 'vsplit' } \ 'ctrl-v': 'vsplit' }
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