mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Insert new panes after the pane being split in the list rather than
always after the active pane. This is more sensible when doing it with commands rather than keys.
This commit is contained in:
12
window.c
12
window.c
@ -323,7 +323,7 @@ window_create(const char *name, int argc, char **argv, const char *path,
|
||||
struct window_pane *wp;
|
||||
|
||||
w = window_create1(sx, sy);
|
||||
wp = window_add_pane(w, hlimit);
|
||||
wp = window_add_pane(w, NULL, hlimit);
|
||||
layout_init(w, wp);
|
||||
|
||||
if (window_pane_spawn(wp, argc, argv, path, shell, cwd, env, tio,
|
||||
@ -553,15 +553,19 @@ window_unzoom(struct window *w)
|
||||
}
|
||||
|
||||
struct window_pane *
|
||||
window_add_pane(struct window *w, u_int hlimit)
|
||||
window_add_pane(struct window *w, struct window_pane *after, u_int hlimit)
|
||||
{
|
||||
struct window_pane *wp;
|
||||
|
||||
wp = window_pane_create(w, w->sx, w->sy, hlimit);
|
||||
if (TAILQ_EMPTY(&w->panes))
|
||||
TAILQ_INSERT_HEAD(&w->panes, wp, entry);
|
||||
else
|
||||
TAILQ_INSERT_AFTER(&w->panes, w->active, wp, entry);
|
||||
else {
|
||||
if (after == NULL)
|
||||
TAILQ_INSERT_AFTER(&w->panes, w->active, wp, entry);
|
||||
else
|
||||
TAILQ_INSERT_AFTER(&w->panes, after, wp, entry);
|
||||
}
|
||||
return (wp);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user