From 21daee34ff2d1d0ca13a79abb315e689ba22d2e3 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 10 Jun 2009 16:47:29 +0100 Subject: [PATCH] Regression. Fixed p4 diff breaking as a result of the directory change. --- .vim/script/p4 | 8 +++++--- .vim/script/svn | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.vim/script/p4 b/.vim/script/p4 index fe7f252..59e28a1 100644 --- a/.vim/script/p4 +++ b/.vim/script/p4 @@ -37,7 +37,12 @@ fun! P4submit() set buftype=nowrite set bufhidden=hide setlocal noswapfile + + " Change directory so "file [p4 diff]" doesn't try to cd somewhere. + let l:cwd=getcwd() + cd / file [p4 diff] + cd l:cwd " Switch back to the top window and put the cursor by the description. wincmd k @@ -57,9 +62,6 @@ endfun let s:cmdheight = &cmdheight set cmdheight=3 -" Change directory so "file [p4 diff]" doesn't try to cd somewhere. -cd / - " Call and then discard our function. call P4submit() delfunction P4submit diff --git a/.vim/script/svn b/.vim/script/svn index 175f4fb..92cc8a5 100644 --- a/.vim/script/svn +++ b/.vim/script/svn @@ -23,7 +23,12 @@ fun! SVNcommit() set buftype=nowrite set bufhidden=hide setlocal noswapfile + + " Change directory so "file [svn diff]" doesn't try to cd somewhere. + let l:cwd=getcwd() + cd / file [svn diff] + cd l:cwd " Switch back to the top window. wincmd k @@ -33,9 +38,6 @@ endfun let s:cmdheight = &cmdheight se cmdheight=3 -" Change directory so "file [svn diff]" doesn't try to cd somewhere. -cd / - " Call and then discard our function. call SVNcommit() delfunction SVNcommit -- 2.20.1