summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonid Volnitsky <Leonid@Volnitsky.com>2011-04-24 16:21:58 +0300
committerLeonid Volnitsky <Leonid@Volnitsky.com>2011-04-24 16:21:58 +0300
commit28b208c552a247acfd1316d52cbabbb67da2220d (patch)
tree11930ba7d476c428969f11f3b837bed9fb8a6880
parentfixed: sed parsing broken dependent on git status output (verbose or not) (diff)
downloadgit-prompt-28b208c552a247acfd1316d52cbabbb67da2220d.tar.gz
git-prompt-28b208c552a247acfd1316d52cbabbb67da2220d.tar.bz2
git-prompt-28b208c552a247acfd1316d52cbabbb67da2220d.zip
vim module display change
if mutilple files edited: display vim:*
-rwxr-xr-xgit-prompt.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/git-prompt.sh b/git-prompt.sh
index d77c5cb..2708eb6 100755
--- a/git-prompt.sh
+++ b/git-prompt.sh
@@ -564,12 +564,17 @@ parse_vcs_status() {
eval $old_nullglob
if [[ $vim_glob ]]; then
- vim_file=${vim_glob#.}
- vim_file=${vim_file/.sw?/}
+ set $vim_glob
+ #vim_file=${vim_glob#.}
+ if [[ $# > 1 ]] ; then
+ vim_files="*"
+ else
+ vim_file=${1#.}
+ vim_file=${vim_file/.sw?/}
+ [[ .${vim_file}.swp -nt $vim_file ]] && vim_files=$vim_file
+ fi
# if swap is newer, then this is unsaved vim session
- #[[ .${vim_file}.swp -nt $vim_file ]] && vim_files=$vim_file
# [temoto custom] if swap is older, then it must be deleted, so show all swaps.
- vim_files=$vim_file
fi
fi