Skip to content

Commit f9707c3

Browse files
committed
Fix erroneous newlines on Linux when syntax highlighting is enabled
1 parent 7aa5744 commit f9707c3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Source/Utility/CachedTextRender.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class CachedTextRender {
4343
bool firstToken = true;
4444
bool hadFlag = false;
4545
bool mathExpression = false;
46-
for (auto& line : lines) {
46+
for (int i = 0; i < lines.size(); i++) {
47+
auto& line = lines[i];
4748
auto tokens = StringArray::fromTokens(line, true);
4849
for (int i = 0; i < tokens.size(); i++) {
4950
auto token = tokens[i];
@@ -66,7 +67,8 @@ class CachedTextRender {
6667
attributedText.append(token, font, colour);
6768
}
6869
}
69-
attributedText.append("\n", font, colour);
70+
if(i != lines.size() - 1)
71+
attributedText.append("\n", font, colour);
7072
}
7173

7274
return attributedText;

0 commit comments

Comments
 (0)