+
+ // Is the inline completion here?
+ if (inlineCompletionData != this
+ || size_t(inlineCompletionPos.pos()) != i + 1)
+ continue;
+ docstring const & completion = bv.inlineCompletion();
+ if (completion.length() == 0)
+ continue;
+ FontInfo f = pi.base.font;
+
+ // 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 = bv.inlineCompletionUniqueChars();
+ docstring s1 = completion.substr(0, uniqueTo);
+ docstring s2 = completion.substr(uniqueTo);
+
+ if (s1.size() > 0) {
+ f.setColor(Color_inlinecompletion);
+ pi.pain.text(x, y, s1, f);
+ x += mathed_string_width(f, s1);
+ }
+
+ if (s2.size() > 0) {
+ f.setColor(Color_nonunique_inlinecompletion);
+ pi.pain.text(x, y, s2, f);
+ x += mathed_string_width(f, s2);
+ }