Select layout after panes initialization (#40)

master
Ivan 3 years ago committed by GitHub
parent 251b6c3f7a
commit bf1e50906e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -126,16 +126,6 @@ func (smug Smug) Start(config Config, options Options, context Context) error {
}
}
layout := w.Layout
if layout == "" {
layout = EvenHorizontal
}
_, err = smug.tmux.SelectLayout(window, layout)
if err != nil {
return err
}
for _, p := range w.Panes {
paneRoot := ExpandPath(p.Root)
if paneRoot == "" || !filepath.IsAbs(p.Root) {
@ -154,6 +144,16 @@ func (smug Smug) Start(config Config, options Options, context Context) error {
}
}
}
layout := w.Layout
if layout == "" {
layout = EvenHorizontal
}
_, err = smug.tmux.SelectLayout(window, layout)
if err != nil {
return err
}
}
smug.tmux.KillWindow(sessionName + defaultWindowName)

@ -78,8 +78,8 @@ var testTable = []struct {
"tmux has-session -t ses:",
"tmux new -Pd -s ses -n smug_def -c root",
"tmux neww -Pd -t ses: -c root -F #{window_id} -n win1",
"tmux select-layout -t 1 main-horizontal",
"tmux split-window -Pd -h -t 1 -c root -F #{pane_id}",
"tmux select-layout -t 1 main-horizontal",
"tmux kill-window -t ses:smug_def",
"tmux move-window -r -s ses: -t ses:",
"tmux attach -d -t ses:win1",
@ -191,9 +191,9 @@ var testTable = []struct {
"tmux has-session -t ses:",
"tmux new -Pd -s ses -n smug_def -c root",
"tmux neww -Pd -t ses: -c root/win1 -F #{window_id} -n win1",
"tmux select-layout -t 1 even-horizontal",
"tmux split-window -Pd -v -t 1 -c root/win1/pane1 -F #{pane_id}",
"tmux send-keys -t 1.1 command1 Enter",
"tmux select-layout -t 1 even-horizontal",
"tmux kill-window -t ses:smug_def",
"tmux move-window -r -s ses: -t ses:",
"tmux attach -d -t ses:win1",

Loading…
Cancel
Save