From e286178aa7f3e98ae76be58fe708db8822c6351c Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 26 Apr 2019 10:15:40 +0000 Subject: [PATCH 1/5] Unbreak main-vertical and main-horizontal layouts. --- layout-set.c | 62 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/layout-set.c b/layout-set.c index 504d9630..3a088a4c 100644 --- a/layout-set.c +++ b/layout-set.c @@ -213,7 +213,7 @@ layout_set_main_h(struct window *w) mainh = w->sy - otherh; } - /* Work out what height is needed. */ + /* Work out what width is needed. */ sx = (n * (PANE_MINIMUM + 1)) - 1; if (sx < w->sx) sx = w->sx; @@ -221,7 +221,7 @@ layout_set_main_h(struct window *w) /* Free old tree and create a new root. */ layout_free(w); lc = w->layout_root = layout_create_cell(NULL); - layout_set_size(lc, sx, mainh + otherh + 1, 0, 0); + layout_set_size(lc, sx, mainh + otherh, 0, 0); layout_make_node(lc, LAYOUT_TOPBOTTOM); /* Create the main pane. */ @@ -233,19 +233,25 @@ layout_set_main_h(struct window *w) /* Create the other pane. */ lcother = layout_create_cell(lc); layout_set_size(lcother, sx, otherh, 0, 0); - layout_make_node(lcother, LAYOUT_LEFTRIGHT); - TAILQ_INSERT_TAIL(&lc->cells, lcother, entry); + if (n == 1) { + wp = TAILQ_NEXT(TAILQ_FIRST(&w->panes), entry); + layout_make_leaf(lcother, wp); + TAILQ_INSERT_TAIL(&lc->cells, lcother, entry); + } else { + layout_make_node(lcother, LAYOUT_LEFTRIGHT); + TAILQ_INSERT_TAIL(&lc->cells, lcother, entry); - /* Add the remaining panes as children. */ - TAILQ_FOREACH(wp, &w->panes, entry) { - if (wp == TAILQ_FIRST(&w->panes)) - continue; - lcchild = layout_create_cell(lc); - layout_set_size(lcchild, PANE_MINIMUM, otherh, 0, 0); - layout_make_leaf(lcchild, wp); - TAILQ_INSERT_TAIL(&lcother->cells, lcchild, entry); + /* Add the remaining panes as children. */ + TAILQ_FOREACH(wp, &w->panes, entry) { + if (wp == TAILQ_FIRST(&w->panes)) + continue; + lcchild = layout_create_cell(lcother); + layout_set_size(lcchild, PANE_MINIMUM, otherh, 0, 0); + layout_make_leaf(lcchild, wp); + TAILQ_INSERT_TAIL(&lcother->cells, lcchild, entry); + } + layout_spread_cell(w, lcother); } - layout_spread_cell(w, lcother); /* Fix cell offsets. */ layout_fix_offsets(lc); @@ -299,7 +305,7 @@ layout_set_main_v(struct window *w) /* Free old tree and create a new root. */ layout_free(w); lc = w->layout_root = layout_create_cell(NULL); - layout_set_size(lc, mainw + otherw + 1, sy, 0, 0); + layout_set_size(lc, mainw + otherw, sy, 0, 0); layout_make_node(lc, LAYOUT_LEFTRIGHT); /* Create the main pane. */ @@ -311,19 +317,25 @@ layout_set_main_v(struct window *w) /* Create the other pane. */ lcother = layout_create_cell(lc); layout_set_size(lcother, otherw, sy, 0, 0); - layout_make_node(lcother, LAYOUT_TOPBOTTOM); - TAILQ_INSERT_TAIL(&lc->cells, lcother, entry); + if (n == 1) { + wp = TAILQ_NEXT(TAILQ_FIRST(&w->panes), entry); + layout_make_leaf(lcother, wp); + TAILQ_INSERT_TAIL(&lc->cells, lcother, entry); + } else { + layout_make_node(lcother, LAYOUT_TOPBOTTOM); + TAILQ_INSERT_TAIL(&lc->cells, lcother, entry); - /* Add the remaining panes as children. */ - TAILQ_FOREACH(wp, &w->panes, entry) { - if (wp == TAILQ_FIRST(&w->panes)) - continue; - lcchild = layout_create_cell(lc); - layout_set_size(lcchild, otherw, PANE_MINIMUM, 0, 0); - layout_make_leaf(lcchild, wp); - TAILQ_INSERT_TAIL(&lcother->cells, lcchild, entry); + /* Add the remaining panes as children. */ + TAILQ_FOREACH(wp, &w->panes, entry) { + if (wp == TAILQ_FIRST(&w->panes)) + continue; + lcchild = layout_create_cell(lcother); + layout_set_size(lcchild, otherw, PANE_MINIMUM, 0, 0); + layout_make_leaf(lcchild, wp); + TAILQ_INSERT_TAIL(&lcother->cells, lcchild, entry); + } + layout_spread_cell(w, lcother); } - layout_spread_cell(w, lcother); /* Fix cell offsets. */ layout_fix_offsets(lc); From 750d5830c2344d28bd6824681dfe5e3222933ef4 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 30 Apr 2019 06:21:30 +0000 Subject: [PATCH 2/5] Don't redraw control clients, from George Nachman. --- cmd-select-pane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd-select-pane.c b/cmd-select-pane.c index 2873737f..747f0822 100644 --- a/cmd-select-pane.c +++ b/cmd-select-pane.c @@ -66,7 +66,7 @@ cmd_select_pane_redraw(struct window *w) */ TAILQ_FOREACH(c, &clients, entry) { - if (c->session == NULL) + if (c->session == NULL || (c->flags & CLIENT_CONTROL)) continue; if (c->session->curw->window == w && tty_window_bigger(&c->tty)) server_redraw_client(c); From 901eed7b71cfb22bc7bd3a1500c74ef4f2fdb095 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 24 Apr 2019 20:27:52 +0000 Subject: [PATCH 3/5] Do not loop forever if there is a nonprintable character in the format. --- format-draw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/format-draw.c b/format-draw.c index b0b050f6..51404254 100644 --- a/format-draw.c +++ b/format-draw.c @@ -837,7 +837,8 @@ format_trim_left(const char *expanded, u_int limit) *out++ = *cp; width++; cp++; - } + } else + cp++; } *out = '\0'; return (copy); @@ -883,7 +884,8 @@ format_trim_right(const char *expanded, u_int limit) *out++ = *cp; width++; cp++; - } + } else + cp++; } *out = '\0'; return (copy); From e36d6ee06afe6ef2467124dc166889c88dfdf341 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 1 May 2019 07:12:14 +0100 Subject: [PATCH 4/5] Version 2.9a. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f04ae14d..c55f55c5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # configure.ac -AC_INIT([tmux], 2.9-rc3) +AC_INIT([tmux], 2.9a) AC_PREREQ([2.60]) AC_CONFIG_AUX_DIR(etc) From 4cb13d95bac1c7a14f216a0fd1644d8b5e389258 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 1 May 2019 07:16:20 +0100 Subject: [PATCH 5/5] Add to CHANGES. --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index e78921fe..a3da3ef0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +CHANGES FROM 2.9 to 2.9a + +* Fix bugs in select-pane and the main-horizontal and main-vertical layouts. + CHANGES FROM 2.8 to 2.9 * Attempt to preserve horizontal cursor position as well as vertical with