summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2017-09-06 22:03:26 -0400
committerJunegunn Choi <junegunn.c@gmail.com>2017-09-07 11:03:26 +0900
commit79d2ef46160fff0a489b8c69b2930b4e1422d74b (patch)
tree8d11258d944ae5ed5cd44f00ae8835c4e35ab7e3
parent5edc3f755ca5f1e5512679cc8e7f995de7e12c3b (diff)
[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
-rw-r--r--plugin/fzf.vim5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index 2f449091..c0bae817 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -772,7 +772,10 @@ let s:default_action = {
\ 'ctrl-v': 'vsplit' }
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) ? '\' : '/'
return empty(short) ? '~'.slash : short . (short =~ escape(slash, '\').'$' ? '' : slash)
endfunction