- // Skip the separator at the logical end of the row
- if (vpos == skipped_sep_vpos) {
- ++vpos;
- continue;
- }
-
- pos_type const pos = bidi_.vis2log(vpos);
-
- if (pos >= par_.size()) {
- ++vpos;
- continue;
- }
-
- // Use font span to speed things up, see above
- if (!font_span.contains(pos)) {
- font_span = par_.fontSpan(pos);
- font = text_metrics_.displayFont(pit_, pos);
-
- // split font span if inline completion is inside
- if (inlineCompletionVPos != -1
- && font_span.contains(inlineCompletionPos.pos()))
- font_span.last = inlineCompletionPos.pos();
- }
-
- // Note that this value will only be used in
- // situations where no ligature of composition of
- // characters is needed. (see comments in uses of width_pos).
- const int width_pos = pm_.singleWidth(pos, font);
-
- Change const & change = par_.lookupChange(pos);
- if (change.changed() && !change_running.changed()) {
- change_running = change;
- change_last_x = int(x_);
- }
-
- Inset const * inset = par_.getInset(pos);
- bool const highly_editable_inset = inset
- && inset->editable();
-
- // If we reach the end of a change or if the author changes, paint it.
- // We also don't paint across things like tables
- if (change_running.changed() && (highly_editable_inset
- || !change.changed() || !change_running.isSimilarTo(change))) {
- // Calculate 1/3 height of the buffer's default font
- FontMetrics const & fm
- = theFontMetrics(pi_.base.bv->buffer().params().getFont());
- float const y_bar = change_running.deleted() ?
- yo_ - fm.maxAscent() / 3 : yo_ + 2 * solid_line_offset_ + solid_line_thickness_;
- pi_.pain.line(change_last_x, int(y_bar), int(x_), int(y_bar),
- change_running.color(), Painter::line_solid, solid_line_thickness_);
-
- // Change might continue with a different author or type
- if (change.changed() && !highly_editable_inset) {
- change_running = change;
- change_last_x = int(x_);
- } else
- change_running.setUnchanged();
- }
-
- if (body_pos > 0 && pos == body_pos - 1) {
- int const lwidth = theFontMetrics(labelFont())
- .width(layout.labelsep);