ui: Disabled syntax highlighting for project description

* Also made syntax highlighting dependent on file ending of source file
This commit is contained in:
Eberhard Graether
2017-02-09 16:05:20 +01:00
parent e08f7ce2c0
commit 3b89bad424
3 changed files with 96 additions and 61 deletions
+15 -1
View File
@@ -111,8 +111,22 @@ QtCodeArea::QtCodeArea(
viewport()->setCursor(Qt::ArrowCursor);
FilePath path = m_locationFile->getFilePath();
LanguageType language = LANGUAGE_UNKNOWN;
if (!path.empty())
{
if (path.extension() == ".java")
{
language = LANGUAGE_JAVA;
}
else
{
language = LANGUAGE_CPP;
}
}
m_lineNumberArea = new LineNumberArea(this);
m_highlighter = new QtHighlighter(document());
m_highlighter = new QtHighlighter(document(), language);
std::string displayCode = m_code;
if (!displayCode.empty() && *displayCode.rbegin() == '\n')