aboutsummaryrefslogtreecommitdiff
path: root/mode-tree.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-07-04 14:01:15 +0100
committerThomas Adam <thomas@xteddy.org>2017-07-04 14:01:15 +0100
commitfeb044bd2d91ec29fd2445e40fa36c23289d7798 (patch)
tree7486d313c6bbbcb482f95d8d3c37dea31dd2d0bc /mode-tree.c
parent6cb4a3bb199b00d7e160b7476c538fd93b906d9e (diff)
parentbedf8bd4373c48761ae42dbd8635fbc65d1c5cf8 (diff)
downloadrtmux-feb044bd2d91ec29fd2445e40fa36c23289d7798.tar.gz
rtmux-feb044bd2d91ec29fd2445e40fa36c23289d7798.tar.bz2
rtmux-feb044bd2d91ec29fd2445e40fa36c23289d7798.zip
Merge branch 'obsd-master'
Diffstat (limited to 'mode-tree.c')
-rw-r--r--mode-tree.c5
1 files changed, 3 insertions, 2 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);