circo

claudio's IRC oasis
git clone git://git.bitsmanent.org/circo
Log | Files | Refs | README | LICENSE

commit d74682c27d9b728113f5c030a0d0bcc9fb1017f1
parent 8ca467b363e064c806417fad2a0d86e89c668f62
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Fri, 28 Jul 2017 20:15:25 +0200

Fix drawcmdln() for very small resizes.

Diffstat:
Mcirco.c | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/circo.c b/circo.c @@ -514,12 +514,14 @@ drawcmdln(void) { return; pslen = 3 + strlen(sel->name); /* "[%s] " */ cmdsz = pslen < cols ? cols - pslen : 0; - if(!cmdsz) { - printf(CURPOS, rows, cols); - return; + if(cmdsz) { + cur = pslen + (sel->cmdoff % cmdsz) + 1; + i = cmdsz ? cmdsz * (sel->cmdoff / cmdsz) : 0; + } + else { + cur = cols; + i = 0; } - cur = pslen + (sel->cmdoff % cmdsz) + 1; - i = cmdsz * (sel->cmdoff / cmdsz); len = snprintf(buf, sizeof buf, "[%s] %s", sel->name, &sel->cmd[i]); mvprintf(1, rows, "%s%s", buf, len < cols ? CLEARRIGHT : ""); printf(CURPOS, rows, cur);