From cc370dba83340d87e3832bab528d36c8b3c207c8 Mon Sep 17 00:00:00 2001 From: Kyle Kneitinger Date: Sat, 8 Aug 2020 20:16:38 -0700 Subject: [PATCH] Replace tmux send-keys/select-pane commands with split-window args --- ftplugin/supercollider.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ftplugin/supercollider.vim b/ftplugin/supercollider.vim index ab5bf10..858b715 100644 --- a/ftplugin/supercollider.vim +++ b/ftplugin/supercollider.vim @@ -259,8 +259,9 @@ function SClangStart(...) wincmd w elseif l:tmux || l:screen if l:tmux - let l:cmd = "tmux split-window -" . l:splitDir . " -p " . l:splitSize . " ;" - let l:cmd .= "tmux send-keys " . s:sclangPipeApp . " Enter ; tmux select-pane -l" + " To disable focusing on the newly created pane, -d flag is used + let l:cmdfmt = "tmux split-window -d -%s -p %d %s" + let l:cmd = printf(l:cmdfmt, l:splitDir, l:splitSize, s:sclangPipeApp) call system(l:cmd) elseif l:screen " Main window will have focus when splitting, so recalculate splitSize percentage