summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2013-09-19 18:08:30 +0200
committerSven Eden <yamakuzure@gmx.net>2013-09-19 18:08:30 +0200
commite7f3fbaf986480b070001b07a3897f2d14cfd4d7 (patch)
tree5c4361101c899680a50150952cc6db6eb06f81b8
parentdrawflag(): Advancing the wrapped description part is put to the end of the l... (diff)
downloadufed-e7f3fbaf986480b070001b07a3897f2d14cfd4d7.tar.gz
ufed-e7f3fbaf986480b070001b07a3897f2d14cfd4d7.tar.bz2
ufed-e7f3fbaf986480b070001b07a3897f2d14cfd4d7.zip
calculateDescWrap(): Position and length correction now work with reversed pkg/desc order, too.
-rw-r--r--ufed-curses-types.c9
1 files 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;
}