The special handling of tabs is best kept in common code.
So move more into do_measure().
Signed-off-by: NeilBrown <neil@brown.name>
### Triage
-- [ ] tabs can wrap around a newline - with part of tab at end of one
+- [X] tabs can wrap around a newline - with part of tab at end of one
line and part at start of the next. Do I want that? do_measure()
- decides.
+ decides. YES.
- [X] in xcb, find-file draws result a pixel high, then moves done
when cursor moves
- [ ] favourites... I want some favourite documents that are easy to
cr.i >= len)
/* All fits in maxwidth */
cr.ret = 2;
+ /* Report position in rd->line */
+ if (str == tb) {
+ cr.s = rd->line + ri->start;
+ if (splitpos + cr.i >= ri->tab_cols)
+ cr.s += 1;
+ } else
+ cr.s = str + cr.i;
return cr;
}
ri->y + rd->line_height * splitpos > y &&
xyattr)
*xyattr = ri->attr;
- if (rd->line[ri->start] == '\t')
- /* do_measure reports how many spaces, we don't care */
- /* FIXME but should do_measure report that? Do I *want*
- * a tab to wrap around a newline??
- */
- cr.i = 0;
+ if (cr.s)
+ return cr.s - rd->line;
return start + cr.i;
}