From eee115c5a05f6e4441f820a67865af17a717ae13 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 4 Nov 2009 22:01:40 +0000 Subject: [PATCH] Fix diffs of files with spaces. Show diffs correctly in p4 and svn Vim scripts when files to diff contain spaces. --- .vim/script/p4 | 2 +- .vim/script/svn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.vim/script/p4 b/.vim/script/p4 index 8b6ee16..3dd4217 100644 --- a/.vim/script/p4 +++ b/.vim/script/p4 @@ -21,7 +21,7 @@ fun! P4submit() set nomod " Get the files in the changelist. - let l:files = system("sed -n 's@^ \\(//.*\\) #.*@\\1@p' " . bufname("")) + 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 if l:files != "" diff --git a/.vim/script/svn b/.vim/script/svn index bb05173..d5244fb 100644 --- a/.vim/script/svn +++ b/.vim/script/svn @@ -5,7 +5,7 @@ fun! SVNcommit() set nomod " Get the modified files. Discount new files. - let l:files = system("sed -n '1,/^$/d;s/^[MR]....//p' " . bufname("")) + let l:files = system("sed -n '1,/^$/d;/^[MR]..../{s//\"/;s/$/\"/p;}' " . bufname("")) if l:files == "" return -- 2.7.4