From 8c332d9919dfc5ab02b3f62f8a00024893213ec5 Mon Sep 17 00:00:00 2001 From: Joakim Bergman Date: Fri, 28 Nov 2014 10:57:17 +0100 Subject: [PATCH] VimuxRunCommandInDir: run in subshell Fixes a problem where the directory is not restored if the command exits with a non-zero code. --- plugin/vimux.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/vimux.vim b/plugin/vimux.vim index 12ae004..be36acc 100644 --- a/plugin/vimux.vim +++ b/plugin/vimux.vim @@ -20,7 +20,7 @@ function! VimuxRunCommandInDir(command, useFile) if a:useFile ==# 1 let l:file = shellescape(expand('%:t'), 1) endif - call VimuxRunCommand("cd ".shellescape(expand('%:p:h'), 1)." && ".a:command." ".l:file." && cd - > /dev/null") + call VimuxRunCommand("(cd ".shellescape(expand('%:p:h'), 1)." && ".a:command." ".l:file.")") endfunction function! VimuxRunLastCommand()