Skip to content
Snippets Groups Projects
Commit 32229e30 authored by mae's avatar mae
Browse files

mark all-whitespace-lines with the correct visual format.

parent f269031b
No related branches found
No related tags found
No related merge requests found
...@@ -73,6 +73,8 @@ void CppHighlighter::highlightBlock(const QString &text) ...@@ -73,6 +73,8 @@ void CppHighlighter::highlightBlock(const QString &text)
userData->setCollapseMode(TextBlockUserData::NoCollapse); userData->setCollapseMode(TextBlockUserData::NoCollapse);
} }
TextEditDocumentLayout::clearParentheses(currentBlock()); TextEditDocumentLayout::clearParentheses(currentBlock());
if (text.length()) // the empty line can still contain whitespace
setFormat(0, text.length(), visualSpaceFormat);
return; return;
} }
...@@ -171,7 +173,7 @@ void CppHighlighter::highlightBlock(const QString &text) ...@@ -171,7 +173,7 @@ void CppHighlighter::highlightBlock(const QString &text)
} }
// mark the trailing white spaces // mark the trailing white spaces
if (! tokens.isEmpty()) { {
const SimpleToken tk = tokens.last(); const SimpleToken tk = tokens.last();
const int lastTokenEnd = tk.position() + tk.length(); const int lastTokenEnd = tk.position() + tk.length();
if (text.length() > lastTokenEnd) if (text.length() > lastTokenEnd)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment