pdfSupportModule->subjectLE));
pdfSupportModule->keywordsLE->setValidator(new NoNewLineValidator(
pdfSupportModule->keywordsLE));
- (void) new LaTeXHighlighter(pdfSupportModule->optionsTE->document(), true, true);
- (void) new LaTeXHighlighter(pdfSupportModule->metadataTE->document(), true, true);
+ (void) new LaTeXHighlighter(pdfSupportModule->optionsTE->document(), true, true, true);
+ (void) new LaTeXHighlighter(pdfSupportModule->metadataTE->document(), true, true, true);
for (int i = 0; backref_opts[i][0]; ++i)
pdfSupportModule->backrefCO->addItem(qt_(backref_opts_gui[i]));
namespace frontend {
-LaTeXHighlighter::LaTeXHighlighter(QTextDocument * parent, bool at_letter, bool keyval)
- : QSyntaxHighlighter(parent), at_letter_(at_letter), keyval_(keyval)
+LaTeXHighlighter::LaTeXHighlighter(QTextDocument * parent, bool at_letter, bool keyval, bool optsnippet)
+ : QSyntaxHighlighter(parent), at_letter_(at_letter), keyval_(keyval), optsnippet_(optsnippet)
{
auto blend = [](QColor color1, QColor color2) {
int r = 0.5 * (color1.red() + color2.red());
}
-void LaTeXHighlighter::highlightBlock(QString const & text)
+void LaTeXHighlighter::highlightBlock(QString const & text_in)
{
+ QString const text = (optsnippet_) ? '[' + text_in + ']' : text_in;
// keyval
if (keyval_) {
// Highlight key-val options. Used in some option widgets.
public:
explicit LaTeXHighlighter(QTextDocument * parent,
bool at_letter = false,
- bool keyval = false);
+ bool keyval = false,
+ bool optsnippet = false);
protected:
void highlightBlock(QString const & text) override;
bool const at_letter_;
// highlight keyval options?
bool const keyval_;
+ // option snippet?
+ bool const optsnippet_;
};
} // namespace frontend