summaryrefslogtreecommitdiffstats
path: root/term_ps.c
diff options
context:
space:
mode:
Diffstat (limited to 'term_ps.c')
-rw-r--r--term_ps.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/term_ps.c b/term_ps.c
index f1129c2d..344db82f 100644
--- a/term_ps.c
+++ b/term_ps.c
@@ -635,12 +635,14 @@ ps_setwidth(struct termp *p, int iop, size_t width)
size_t lastwidth;
lastwidth = p->ps->width;
- if (0 < iop)
+ if (iop > 0)
p->ps->width += width;
- else if (0 > iop)
+ else if (iop == 0)
+ p->ps->width = width ? width : p->ps->lastwidth;
+ else if (p->ps->width > width)
p->ps->width -= width;
else
- p->ps->width = width ? width : p->ps->lastwidth;
+ p->ps->width = 0;
p->ps->lastwidth = lastwidth;
}