dhaumann added a comment.
Unfortunately, I still see one issue: In the unit test, expanding the variable to "World" works, but expanding it to "Smart World" leads to single-quoted text "'Smart World'" because of the space. That of course makes sense, but is not always what you want. Therefore, I suggest we expand the API as follows: bool expandVariable(const QString& variable, KTextEditor::View* view, QString& output, KTextEditor::ExpansionMode mode = QuoteWhenNeeded) const; bool expandText(const QString& text, KTextEditor::View* view, QString& output, KTextEditor::ExpansionMode mode = QuoteWhenNeeded) const; with enum class KTextEditor::ExpansionMode { Never, QuoteWhenNeeded } Any comments? REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D19795 To: dhaumann, cullmann Cc: kwrite-devel, kde-frameworks-devel, gennad, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann