From 837ca176d1874273f3de615c75b506e1b1787a1b Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 13 Oct 2021 09:28:36 +0000 Subject: Add popup-style and popup-border-style options, from Alexis Hildebrandt in GitHub issue 2927. --- window-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'window-tree.c') diff --git a/window-tree.c b/window-tree.c index e7029d33..a721f1b5 100644 --- a/window-tree.c +++ b/window-tree.c @@ -519,7 +519,7 @@ window_tree_draw_label(struct screen_write_ctx *ctx, u_int px, u_int py, if (ox > 1 && ox + len < sx - 1 && sy >= 3) { screen_write_cursormove(ctx, px + ox - 1, py + oy - 1, 0); - screen_write_box(ctx, len + 2, 3); + screen_write_box(ctx, len + 2, 3, NULL); } screen_write_cursormove(ctx, px + ox, py + oy, 0); screen_write_puts(ctx, gc, "%s", label); -- cgit From add20637f256c0118d3c687d5d1446612d14389a Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 14 Oct 2021 13:19:01 +0000 Subject: Add popup-border-lines option to set popup line style, from Alexis Hildebrandt, GitHub issue 2930. --- window-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'window-tree.c') diff --git a/window-tree.c b/window-tree.c index a721f1b5..d22a2b58 100644 --- a/window-tree.c +++ b/window-tree.c @@ -519,7 +519,7 @@ window_tree_draw_label(struct screen_write_ctx *ctx, u_int px, u_int py, if (ox > 1 && ox + len < sx - 1 && sy >= 3) { screen_write_cursormove(ctx, px + ox - 1, py + oy - 1, 0); - screen_write_box(ctx, len + 2, 3, NULL); + screen_write_box(ctx, len + 2, 3, BOX_LINES_DEFAULT, NULL); } screen_write_cursormove(ctx, px + ox, py + oy, 0); screen_write_puts(ctx, gc, "%s", label); -- cgit From 8a9bfd0cddd783436e842495fc3039aa56571ed1 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 20 Oct 2021 09:50:40 +0000 Subject: Add -T to set a popup title, from Alexis Hildebrandt in GitHub issue 2941. --- window-tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'window-tree.c') diff --git a/window-tree.c b/window-tree.c index d22a2b58..b594edd9 100644 --- a/window-tree.c +++ b/window-tree.c @@ -519,7 +519,8 @@ window_tree_draw_label(struct screen_write_ctx *ctx, u_int px, u_int py, if (ox > 1 && ox + len < sx - 1 && sy >= 3) { screen_write_cursormove(ctx, px + ox - 1, py + oy - 1, 0); - screen_write_box(ctx, len + 2, 3, BOX_LINES_DEFAULT, NULL); + screen_write_box(ctx, len + 2, 3, BOX_LINES_DEFAULT, NULL, + NULL); } screen_write_cursormove(ctx, px + ox, py + oy, 0); screen_write_puts(ctx, gc, "%s", label); -- cgit From 3a6d82b7c8d4254fa87959d8cf19b313f5e05480 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 6 Apr 2022 16:39:46 +0100 Subject: Some style nits. --- window-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'window-tree.c') diff --git a/window-tree.c b/window-tree.c index 77011ea2..d90bf817 100644 --- a/window-tree.c +++ b/window-tree.c @@ -895,7 +895,7 @@ window_tree_get_key(void *modedata, void *itemdata, u_int line) key = key_string_lookup_string(expanded); free(expanded); format_free(ft); - return key; + return (key); } static struct screen * -- cgit From 0a8f356c7278dba34a526adea03561f2063df359 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 30 May 2022 12:55:25 +0000 Subject: Spacing/style nits. --- window-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'window-tree.c') diff --git a/window-tree.c b/window-tree.c index b594edd9..fc21af43 100644 --- a/window-tree.c +++ b/window-tree.c @@ -895,7 +895,7 @@ window_tree_get_key(void *modedata, void *itemdata, u_int line) key = key_string_lookup_string(expanded); free(expanded); format_free(ft); - return key; + return (key); } static struct screen * -- cgit From 9360e0ef329c12931bb97f42197a56776bb3d2f0 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 4 Jul 2022 08:39:45 +0000 Subject: Sort panes by index not by ID, GitHub issue 3249. --- window-tree.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'window-tree.c') diff --git a/window-tree.c b/window-tree.c index fc21af43..00c7c0cc 100644 --- a/window-tree.c +++ b/window-tree.c @@ -272,9 +272,10 @@ window_tree_cmp_window(const void *a0, const void *b0) static int window_tree_cmp_pane(const void *a0, const void *b0) { - const struct window_pane *const *a = a0; - const struct window_pane *const *b = b0; - int result; + struct window_pane **a = (struct window_pane **)a0; + struct window_pane **b = (struct window_pane **)b0; + int result; + u_int ai, bi; if (window_tree_sort->field == WINDOW_TREE_BY_TIME) result = (*a)->active_point - (*b)->active_point; @@ -283,7 +284,9 @@ window_tree_cmp_pane(const void *a0, const void *b0) * Panes don't have names, so use number order for any other * sort field. */ - result = (*a)->id - (*b)->id; + window_pane_index(*a, &ai); + window_pane_index(*b, &bi); + result = ai - bi; } if (window_tree_sort->reversed) result = -result; @@ -1243,12 +1246,17 @@ window_tree_key(struct window_mode_entry *wme, struct client *c, item = mode_tree_get_current(data->data); finished = mode_tree_key(data->data, c, &key, m, &x, &y); + +again: if (item != (new_item = mode_tree_get_current(data->data))) { item = new_item; data->offset = 0; } - if (KEYC_IS_MOUSE(key) && m != NULL) + if (KEYC_IS_MOUSE(key) && m != NULL) { key = window_tree_mouse(data, key, x, item); + goto again; + } + switch (key) { case '<': data->offset--; -- cgit