From 459b971a6a231705056731b5f8278826ee6b52bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=CC=81mi=20Pre=CC=81vost?= Date: Sun, 23 Oct 2011 21:41:06 -0400 Subject: [PATCH] Fix bug with split target --- lib/teamocil/layout.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/teamocil/layout.rb b/lib/teamocil/layout.rb index b7077c4..ddd363c 100644 --- a/lib/teamocil/layout.rb +++ b/lib/teamocil/layout.rb @@ -105,15 +105,17 @@ module Teamocil commands = [] # Is it a vertical or horizontal split? + init_command = "" unless @index == 0 if !@width.nil? - commands << "tmux split-window -h -p #{@width}" + init_command = "tmux split-window -h -p #{@width}" elsif !@height.nil? - commands << "tmux split-window -p #{@height}" + init_command = "tmux split-window -p #{@height}" else - commands << "tmux split-window" + init_command = "tmux split-window" end - commands << " -t #{@target}" unless @target.nil? + init_command << " -t #{@target}" unless @target.nil? + commands << init_command end # Wrap all commands around filters