Changeset View
Changeset View
Standalone View
Standalone View
src/lib/syntaxhighlighter.cpp
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | |||||
78 | } | 78 | } | ||
79 | 79 | | |||
80 | SyntaxHighlighter::~SyntaxHighlighter() | 80 | SyntaxHighlighter::~SyntaxHighlighter() | ||
81 | { | 81 | { | ||
82 | } | 82 | } | ||
83 | 83 | | |||
84 | void SyntaxHighlighter::setDefinition(const Definition &def) | 84 | void SyntaxHighlighter::setDefinition(const Definition &def) | ||
85 | { | 85 | { | ||
86 | const auto needsRehighlight = definition() != def; | | |||
87 | AbstractHighlighter::setDefinition(def); | 86 | AbstractHighlighter::setDefinition(def); | ||
88 | if (needsRehighlight) | | |||
89 | rehighlight(); | 87 | rehighlight(); | ||
90 | } | 88 | } | ||
91 | 89 | | |||
92 | bool SyntaxHighlighter::startsFoldingRegion(const QTextBlock &startBlock) const | 90 | bool SyntaxHighlighter::startsFoldingRegion(const QTextBlock &startBlock) const | ||
93 | { | 91 | { | ||
94 | return SyntaxHighlighterPrivate::foldingRegion(startBlock).type() == FoldingRegion::Begin; | 92 | return SyntaxHighlighterPrivate::foldingRegion(startBlock).type() == FoldingRegion::Begin; | ||
95 | } | 93 | } | ||
96 | 94 | | |||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |