Restore window height when leaving Vim.
[profile.git] / .vim / script / p4
index 59e28a1..3dd4217 100644 (file)
@@ -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 != ""
@@ -37,12 +37,7 @@ 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
+        file [p4 diff\]
 
         " Switch back to the top window and put the cursor by the description.
         wincmd k