ui: Extracted syntax highlighting rules for java and cpp to files
* pass file language from storage to code view * load syntax highlighting rules files from install directory "syntax_highlighting_rules" * files must be named <language_identifier>.rules to make syntax highlighting work
This commit is contained in:
@@ -87,14 +87,7 @@ QtCodeField::QtCodeField(
|
||||
|
||||
createAnnotations(locationFile);
|
||||
|
||||
FilePath path = locationFile->getFilePath();
|
||||
LanguageType language = LANGUAGE_UNKNOWN;
|
||||
if (!path.empty())
|
||||
{
|
||||
language = (path.extension() == L".java" ? LANGUAGE_JAVA : LANGUAGE_CPP);
|
||||
}
|
||||
|
||||
m_highlighter = std::make_shared<QtHighlighter>(document(), language);
|
||||
m_highlighter = std::make_shared<QtHighlighter>(document(), locationFile->getLanguage());
|
||||
m_highlighter->highlightDocument();
|
||||
|
||||
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
|
||||
|
||||
Reference in New Issue
Block a user