aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp')
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp
index ff5254cb6e5..af269d14d03 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp
@@ -38,7 +38,15 @@ void Context::resolveContexts(DefinitionData &def, const HighlightingContextData
m_lineEndContext.resolve(def, data.lineEndContext);
m_lineEmptyContext.resolve(def, data.lineEmptyContext);
m_fallthroughContext.resolve(def, data.fallthroughContext);
- m_fallthrough = !m_fallthroughContext.isStay();
+ m_stopEmptyLineContextSwitchLoop = data.stopEmptyLineContextSwitchLoop;
+
+ /**
+ * line end context switches only when lineEmptyContext is #stay. This avoids
+ * skipping empty lines after a line continuation character (see bug 405903)
+ */
+ if (m_lineEmptyContext.isStay()) {
+ m_lineEmptyContext = m_lineEndContext;
+ }
m_rules.reserve(data.rules.size());
for (const auto &ruleData : data.rules) {
@@ -65,6 +73,7 @@ void Context::resolveIncludes(DefinitionData &def)
for (auto it = m_rules.begin(); it != m_rules.end();) {
const IncludeRules *includeRules = it->get()->castToIncludeRules();
if (!includeRules) {
+ m_hasDynamicRule = m_hasDynamicRule || it->get()->isDynamic();
++it;
continue;
}
@@ -111,6 +120,8 @@ void Context::resolveIncludes(DefinitionData &def)
context->resolveIncludes(*defData);
}
+ m_hasDynamicRule = m_hasDynamicRule || context->m_hasDynamicRule;
+
/**
* handle included attribute
* transitive closure: we might include attributes included from somewhere else