From b8a531b9b8b651820a9a01175e42934bce095a1a Mon Sep 17 00:00:00 2001 From: Chris Toomey Date: Wed, 28 Nov 2012 20:30:12 -0500 Subject: [PATCH] Allow VtrSendCommandToRunner cmd to accept args --- plugin/vim-tmux-runner.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin/vim-tmux-runner.vim b/plugin/vim-tmux-runner.vim index 9e26eb9..022580b 100644 --- a/plugin/vim-tmux-runner.vim +++ b/plugin/vim-tmux-runner.vim @@ -1,6 +1,5 @@ -" TODO: full command and option docs " TODO: maximize command -" TODO: normalize naming, 'runner' not 'pane' +" TODO: open pane in other window, then copy in (avoid flickering during init) function! s:InitVariable(var, value) if !exists(a:var) @@ -250,7 +249,10 @@ function! s:FlushCommand() endif endfunction -function! s:SendCommandToRunner() +function! s:SendCommandToRunner(...) + if exists("a:1") && a:1 != "" + let s:user_command = shellescape(a:1) + endif if !exists("s:user_command") let s:user_command = s:HighlightedPrompt(g:VtrPrompt) endif @@ -284,7 +286,7 @@ function! VtrSendCommand(command) endfunction function! s:DefineCommands() - command! VtrSendCommandToRunner :call s:SendCommandToRunner() + command! -nargs=? VtrSendCommandToRunner call s:SendCommandToRunner() command! VtrOpenRunner :call s:EnsureRunnerPane() command! VtrKillRunner :call s:KillRunnerPane() command! VtrFocusRunner :call s:FocusRunnerPane()