"width" should be the sum of item widths without reference to wrapping
or tabs. Maybe tabs should count, but -ve measures would not be useful,
so just ignore them for now.
This allows rtab in menu formats to work.
Also don't include shift_left in the width. render-lines assumed it did
(which it did, but now doesn't).
Signed-off-by: NeilBrown <neil@brown.name>
break;
}
+ rd->width = 0;
for (ri = rd->content; ri; ri = ri->next) {
ri->hidden = (ri->hide && ri->hide != offset_hide);
if (ri->hidden) {
if (cr.i2 > rd->ascent)
rd->ascent = cr.i2;
ri->width = ri->eol ? 0 : cr.x;
+ rd->width += ri->width;
if (ri->start <= offset && offset <= ri->start + ri->len) {
cr = measure_str(p, "M", ri->attr);
*/
x = left_margin - (shift_left > 0 ? shift_left : 0);
y = rd->space_above * curs_height / 10;
- rd->width = 0;
for (ri = rd->content; ri; ri = ri->next) {
int w, margin;
struct render_item *ri2;
rd->curs_width);
if (ri->eol) {
/* EOL */
- if (x > rd->width)
- rd->width = x;
ri->x = x;
x = 0; /* Don't include shift. probably not margin */
if (rd->line[ri->start])
*/
cols = pane_attr_get_int(hp, "width", 0);
while ((hp->cx < prefix_len
- || cols + curs_width * 8 + curs_width < p->w) &&
+ || (cols-rl->shift_left) + curs_width * 8 + curs_width < p->w) &&
rl->shift_left > 0 &&
shifts++ < 1000 &&
hp->cx + curs_width * 8 < p->w) {