Skip to content

Commit a221eb2

Browse files
committed
Merge pull request #37 from abstiles/patch-autoreturn
Remember autoreturn setting
2 parents dc4a45d + 539580e commit a221eb2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

plugin/vimux.vim

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function VimuxRunCommand(command, ...)
3939
endif
4040

4141
let g:_VimTmuxCmd = a:command
42+
let g:_VimTmuxCmdAutoreturn = l:autoreturn
4243

4344
if l:autoreturn == 1
4445
ruby CurrentTmuxSession.new.run_shell_command(Vim.evaluate("g:_VimTmuxCmd"))
@@ -57,6 +58,7 @@ function RunVimTmuxCommand(command, ...)
5758
endif
5859

5960
let g:_VimTmuxCmd = a:command
61+
let g:_VimTmuxCmdAutoreturn = l:autoreturn
6062

6163
if l:autoreturn == 1
6264
ruby CurrentTmuxSession.new.run_shell_command(Vim.evaluate("g:_VimTmuxCmd"))
@@ -68,7 +70,11 @@ endfunction
6870

6971
function VimuxRunLastCommand()
7072
if exists("g:_VimTmuxCmd")
71-
ruby CurrentTmuxSession.new.run_shell_command(Vim.evaluate("g:_VimTmuxCmd"))
73+
if g:_VimTmuxCmdAutoreturn == 1
74+
ruby CurrentTmuxSession.new.run_shell_command(Vim.evaluate("g:_VimTmuxCmd"))
75+
else
76+
ruby CurrentTmuxSession.new.run_shell_command(Vim.evaluate("g:_VimTmuxCmd"), false)
77+
endif
7278
else
7379
echo "No last command"
7480
endif

0 commit comments

Comments
 (0)