summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Shepelev <temotor@gmail.com>2010-04-06 06:23:08 +0800
committerLeonid Volnitsky <leonid@volnitsky.com>2010-04-09 20:49:05 +0800
commit3b4c0c31a76c4087a60a6b57a1f0e231acf3e364 (patch)
tree669d97e193fa1fa024c1c8e45cd6ee18ec11f3f6
parentAlso read ~/.config/git-prompt.conf. (diff)
downloadgit-prompt-3b4c0c31a76c4087a60a6b57a1f0e231acf3e364.tar.gz
git-prompt-3b4c0c31a76c4087a60a6b57a1f0e231acf3e364.tar.bz2
git-prompt-3b4c0c31a76c4087a60a6b57a1f0e231acf3e364.zip
[vim_module] More relaxed swap mask: .*.sw? and swap time check removed (show all swap files).
There may be more than one swap file: .swo, .swn and so on.
-rwxr-xr-xgit-prompt.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/git-prompt.sh b/git-prompt.sh
index 54c970b..b404a24 100755
--- a/git-prompt.sh
+++ b/git-prompt.sh
@@ -565,14 +565,16 @@ parse_vcs_status() {
unset vim_glob vim_file vim_files
old_nullglob=`shopt -p nullglob`
shopt -s nullglob
- vim_glob=`echo .*.swp`
+ vim_glob=`echo .*.sw?`
eval $old_nullglob
if [[ $vim_glob ]]; then
vim_file=${vim_glob#.}
- vim_file=${vim_file%.swp}
+ vim_file=${vim_file/.sw?/}
# if swap is newer, then this is unsaved vim session
- [[ .${vim_file}.swp -nt $vim_file ]] && vim_files=$vim_file
+ #[[ .${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