- int const middle = yo_ - fm.maxAscent() / 3;
- pi_.pain.line(last_strikeout_x, middle, int(x_), middle,
- Color_deletedtext, Painter::line_solid, Painter::line_thin);
- running_strikeout = false;
+ int const y_bar = change_running.deleted() ?
+ yo_ - fm.maxAscent() / 3 : yo_ + fm.maxAscent() / 6;
+ pi_.pain.line(change_last_x, y_bar, int(x_), y_bar,
+ change_running.color(), Painter::line_solid, Painter::line_thin);
+ change_running.setUnchanged();
+ }
+}
+
+
+void RowPainter::paintInlineCompletion(Font const & font)
+{
+ docstring completion = pi_.base.bv->inlineCompletion();
+ FontInfo f = font.fontInfo();
+ bool rtl = font.isRightToLeft();
+
+ // draw the unique and the non-unique completion part
+ // Note: this is not time-critical as it is
+ // only done once per screen.
+ size_t uniqueTo = pi_.base.bv->inlineCompletionUniqueChars();
+ docstring s1 = completion.substr(0, uniqueTo);
+ docstring s2 = completion.substr(uniqueTo);
+ ColorCode c1 = Color_inlinecompletion;
+ ColorCode c2 = Color_nonunique_inlinecompletion;
+
+ // right to left?
+ if (rtl) {
+ swap(s1, s2);
+ swap(c1, c2);
+ }
+
+ if (s1.size() > 0) {
+ f.setColor(c1);
+ pi_.pain.text(int(x_), yo_, s1, f);
+ x_ += theFontMetrics(font).width(s1);
+ }
+
+ if (s2.size() > 0) {
+ f.setColor(c2);
+ pi_.pain.text(int(x_), yo_, s2, f);
+ x_ += theFontMetrics(font).width(s2);