git.y1.nz

mtm

Ncurses-based terminal multiplexer
download: https://git.y1.nz/archives/mtm.tar.gz
Files | Log | Refs

commit e2e1b84f380e708561e32d0414c282ceae6d82eb
parent 7f908203be689c23e7aae9ed7d25a33c2314c762
Author: Rob King <jking@deadpixi.com>
Date:   Tue, 11 Apr 2017 16:29:39 -0500

Fix occaisional off-by-one on split dimensions.

Diffstat:
Mmtm.c7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mtm.c b/mtm.c @@ -797,11 +797,13 @@ static void reshapechildren(NODE *n) /* Reshape all children of a view. */ { if (n->t == HORIZONTAL){ + int i = n->w % 2? 0 : 1; reshape(n->c1, n->y, n->x, n->h, n->w / 2); - reshape(n->c2, n->y, n->x + n->w / 2 + 1, n->h, n->w / 2 - 1); + reshape(n->c2, n->y, n->x + n->w / 2 + 1, n->h, n->w / 2 - i); } else if (n->t == VERTICAL){ + int i = n->h % 2? 0 : 1; reshape(n->c1, n->y, n->x, n->h / 2, n->w); - reshape(n->c2, n->y + n->h / 2 + 1, n->x, n->h / 2 - 1, n->w); + reshape(n->c2, n->y + n->h / 2 + 1, n->x, n->h / 2 - i, n->w); } } @@ -852,7 +854,6 @@ split(NODE *n, node_t t) /* Split a node. */ if (!v) return; - /* XXX wclear(n->win);*/ wrefresh(n->win); NODE *c = newcontainer(t, n->p, n->y, n->x, n->h, n->w, n, v); if (!c){ freenode(v, false);

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.