- highlighter = new srchilite::SourceHighlight ("esc.outlang");
- highlighter->setStyleFile ("esc.style");
+ if (highlighter == nullptr)
+ {
+ highlighter = new srchilite::SourceHighlight ("esc.outlang");
+ highlighter->setStyleFile ("esc.style");
+ }
+
+ std::istringstream input (contents);
+ std::ostringstream output;
+ highlighter->highlight (input, output, lang_name, fullname);
+ contents = output.str ();
+ already_styled = true;