Fix forgotten colors in SyntaxHighlighter, tests still need updating

This commit is contained in:
Robin Jadoul 2016-05-31 14:12:03 +02:00
parent 7403357b71
commit a7f30688fe
1 changed files with 4 additions and 2 deletions

View File

@ -38,7 +38,7 @@ void Highlighter::process() {
newtoken.type = nonmatching;
break;
}
newtoken.color = colormap.find(newtoken.type)->second; // get the appropriate color
newtoken.color = colormap[newtoken.type]; // get the appropriate color
m_tokens.push_back(newtoken);
} catch (XMLLexer::NoMoreTokens &err) {
break; // We reached the end of the file
@ -47,6 +47,7 @@ void Highlighter::process() {
newtoken.content = m_lexer->peek();
m_lexer->skip(1);
newtoken.type = nonmatching;
newtoken.color = colormap[nonmatching];
m_tokens.push_back(newtoken);
}
}
@ -81,7 +82,7 @@ void Highlighter::process() {
newtoken.type = nonmatching;
break;
}
newtoken.color = colormap.find(newtoken.type)->second;
newtoken.color = colormap[newtoken.type];
m_tokens.push_back(newtoken);
} catch (AttributeLexer::NoMoreTokens &err) {
break;
@ -90,6 +91,7 @@ void Highlighter::process() {
newtoken.content = attributelexer.peek();
attributelexer.skip(1);
newtoken.type = nonmatching;
newtoken.color = colormap[nonmatching];
m_tokens.push_back(newtoken);
}
}