From e7f3fbaf986480b070001b07a3897f2d14cfd4d7 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Thu, 19 Sep 2013 18:08:30 +0200 Subject: calculateDescWrap(): Position and length correction now work with reversed pkg/desc order, too. --- ufed-curses-types.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ufed-curses-types.c b/ufed-curses-types.c index 71d751a..fad7b2d 100644 --- a/ufed-curses-types.c +++ b/ufed-curses-types.c @@ -595,13 +595,18 @@ static void calculateDescWrap(sDesc* desc) --left; } - // Correct length if this is the package list + // Correct pos and length if this is the package list // Note: in drawflag() the string is pre- and postfixed with '(' / ')' if (pch == pPkg) { - if (!curr->pos) + // And one to start + if (oLen == curr->pos) ++curr->len; + // Add one to the end if (end >= (wLen - 1)) ++curr->len; + // If this is not the first line, add one to pos: + if (curr->pos && (oLen != curr->pos)) + ++curr->pos; } -- cgit v1.2.3-65-gdbad