tip += ")";
}
tip += ": ";
- OutputParams rp(&buffer().params().encoding());
- odocstringstream ods;
- InsetText::plaintext(ods, rp);
- tip += ods.str();
- return wrapParas(tip);
+ return InsetText::toolTipText(tip);
}
docstring InsetPhantom::toolTip(BufferView const &, int, int) const
{
- OutputParams rp(&buffer().params().encoding());
- odocstringstream ods;
- InsetCollapsable::plaintext(ods, rp);
- docstring content_tip = support::wrapParas(ods.str());
+ docstring const tip = InsetText::toolTipText();
docstring res = phantomtranslator_loc().find(params_.type);
- if (!content_tip.empty())
- res += from_ascii(": ") + "\n" + content_tip;
+ if (!tip.empty())
+ res += from_ascii(": ") + "\n" + tip;
return res;
}
}
-docstring InsetText::toolTipText() const
+docstring InsetText::toolTipText(docstring prefix) const
{
static unsigned int max_length = 400; // five 80 column lines
OutputParams rp(&buffer().params().encoding());
odocstringstream oss;
+ oss << prefix;
ParagraphList::const_iterator beg = paragraphs().begin();
ParagraphList::const_iterator end = paragraphs().end();
///
void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const;
/// returns the text to be used as tooltip
- docstring toolTipText() const;
+ /// \param prefix: a string that will preced the tooltip,
+ /// e.g., "Index: ".
+ docstring toolTipText(docstring prefix = from_ascii("")) const;
///
virtual docstring contextMenu(BufferView const & bv, int x, int y) const;