diff options
author | Leandro Melo <leandro.melo@nokia.com> | 2010-09-30 09:12:59 +0200 |
---|---|---|
committer | Leandro Melo <leandro.melo@nokia.com> | 2010-09-30 09:25:09 +0200 |
commit | 129b53f616e9e4437811c7a12e22c1af80f0baaa (patch) | |
tree | 680bec6cefce2c7005da9c6f6d001dddc3d7839c /src/plugins/texteditor/generichighlighter/highlighter.cpp | |
parent | c9e819b5376feb7616cf12eaf15577ce8f2c4f03 (diff) | |
download | qt-creator-129b53f616e9e4437811c7a12e22c1af80f0baaa.tar.gz |
Profile editor: Add proper format to white spaces.
The generic highlighter already provided a method for this.
This method was then lifted to the base syntax highlighter
and it is now used by the profile highlighter.
Reviewed-by: Roberto Raggi
Task-number: QTCREATORBUG-2448
Diffstat (limited to 'src/plugins/texteditor/generichighlighter/highlighter.cpp')
-rw-r--r-- | src/plugins/texteditor/generichighlighter/highlighter.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/plugins/texteditor/generichighlighter/highlighter.cpp b/src/plugins/texteditor/generichighlighter/highlighter.cpp index 98de86d7fa..3775a63d51 100644 --- a/src/plugins/texteditor/generichighlighter/highlighter.cpp +++ b/src/plugins/texteditor/generichighlighter/highlighter.cpp @@ -140,7 +140,7 @@ void Highlighter::highlightBlock(const QString &text) } } - applyVisualWhitespaceFormat(text); + applyFormatToSpaces(text, m_creatorFormats.value(VisualWhitespace)); } void Highlighter::setupDataForBlock(const QString &text) @@ -408,22 +408,6 @@ void Highlighter::applyFormat(int offset, } } -void Highlighter::applyVisualWhitespaceFormat(const QString &text) -{ - int offset = 0; - const int length = text.length(); - while (offset < length) { - if (text.at(offset).isSpace()) { - int start = offset++; - while (offset < length && text.at(offset).isSpace()) - ++offset; - setFormat(start, offset - start, m_creatorFormats.value(VisualWhitespace)); - } else { - ++offset; - } - } -} - void Highlighter::createWillContinueBlock() { BlockData *data = blockData(currentBlockUserData()); |