aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicm <nicm>2017-07-04 12:26:14 +0000
committernicm <nicm>2017-07-04 12:26:14 +0000
commitbedf8bd4373c48761ae42dbd8635fbc65d1c5cf8 (patch)
treef5c939e0af13f1d55c53ed7645204277f061b94a
parent4039802fced4cf9906a6c8cf7833dfe1e3de8737 (diff)
downloadrtmux-bedf8bd4373c48761ae42dbd8635fbc65d1c5cf8.tar.gz
rtmux-bedf8bd4373c48761ae42dbd8635fbc65d1c5cf8.tar.bz2
rtmux-bedf8bd4373c48761ae42dbd8635fbc65d1c5cf8.zip
Handle 0 size of preview box in caller.
-rw-r--r--mode-tree.c5
-rw-r--r--window-tree.c4
2 files changed, 3 insertions, 6 deletions
diff --git a/mode-tree.c b/mode-tree.c
index 10a56304..8ce4c403 100644
--- a/mode-tree.c
+++ b/mode-tree.c
@@ -445,7 +445,7 @@ void
mode_tree_draw(struct mode_tree_data *mtd)
{
struct window_pane *wp = mtd->wp;
- struct screen *s = &mtd->screen, *box;
+ struct screen *s = &mtd->screen, *box = NULL;
struct mode_tree_line *line;
struct mode_tree_item *mti;
struct options *oo = wp->window->options;
@@ -571,7 +571,8 @@ mode_tree_draw(struct mode_tree_data *mtd)
box_x = w - 4;
box_y = sy - h - 2;
- box = mtd->drawcb(mtd->modedata, mti->itemdata, box_x, box_y);
+ if (box_x != 0 && box_y != 0)
+ box = mtd->drawcb(mtd->modedata, mti->itemdata, box_x, box_y);
if (box != NULL) {
screen_write_cursormove(&ctx, 2, h + 1);
screen_write_copy(&ctx, box, 0, 0, box_x, box_y, NULL, NULL);
diff --git a/window-tree.c b/window-tree.c
index 488a2e6d..2cbb18a7 100644
--- a/window-tree.c
+++ b/window-tree.c
@@ -422,8 +422,6 @@ window_tree_draw_session(struct session *s, struct screen_write_ctx *ctx,
char *label;
size_t len;
- if (sx == 0)
- return;
total = winlink_count(&s->windows);
memcpy(&gc, &grid_default_cell, sizeof gc);
@@ -544,8 +542,6 @@ window_tree_draw_window(struct session *s, struct window *w,
char *label;
size_t len;
- if (sx == 0)
- return;
total = window_count_panes(w);
memcpy(&gc, &grid_default_cell, sizeof gc);