forked from qt-creator/qt-creator
TextEditor: add convenience function to clear all extra highlights
Change-Id: Id3a3c45041a23ba100447d926ed6ab829abbc92b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -721,6 +721,15 @@ void SyntaxHighlighter::clearExtraFormats(const QTextBlock &block)
|
||||
d->inReformatBlocks = wasInReformatBlocks;
|
||||
}
|
||||
|
||||
void SyntaxHighlighter::clearAllExtraFormats()
|
||||
{
|
||||
QTextBlock b = document()->firstBlock();
|
||||
while (b.isValid()) {
|
||||
clearExtraFormats(b);
|
||||
b = b.next();
|
||||
}
|
||||
}
|
||||
|
||||
/* Generate at least n different colors for highlighting, excluding background
|
||||
* color. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user