git://git.iain.cx/iain
/
profile.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Yet another hardstatus tweak.
[profile.git]
/
.vim
/
script
/
p4
diff --git
a/.vim/script/p4
b/.vim/script/p4
index
9f77833
..
f599b3f
100644
(file)
--- a/
.vim/script/p4
+++ b/
.vim/script/p4
@@
-5,19
+5,30
@@
fun! P4submit()
" There's no point doing this if the spec is readonly. That probably means
" it's a submitted change.
if ! &ro
" There's no point doing this if the spec is readonly. That probably means
" it's a submitted change.
if ! &ro
+ setf perforce
+
" Clear the unnamed register.
let @" = ""
try
" Delete the spec blurb if it exists.
" Clear the unnamed register.
let @" = ""
try
" Delete the spec blurb if it exists.
- /^# A Perforce Change Spec/,/^$/d
+ /^# A Perforce Change Spec/,/^
# *(New changelists only\.)
$/d
" If the blurb was deleted the text will be in the unnamed register.
" If the blurb was deleted the text will be in the unnamed register.
- if @" != ""
+ if @" != "grgergregergeg"
+ " Delete the blank line left above the remaining fields.
+ 1
+ delete
+
" Allow closing an unmodified spec.
set nomod
" Allow closing an unmodified spec.
set nomod
+ " Get the files in the changelist.
+ let l:files = system("sed -n 's@^ \\(//.*\\) #.*@\\1@p' " . bufname(""))
" Create a new window, move it below the spec and read in a diff.
botright new
" Create a new window, move it below the spec and read in a diff.
botright new
- r!p4 diff
+ if l:files != ""
+ exe "r!env P4DIFF= p4 diff -du " . substitute(l:files, "\n", " ", "g")
+ endif
+
setf diff
" Delete the blank line left above the diff.
setf diff
" Delete the blank line left above the diff.