diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.5) set(KF5_VERSION "5.56.0") # handled by release scripts -set(KF5_DEP_VERSION "5.56.0") # handled by release scripts +set(KF5_DEP_VERSION "5.55.0") # handled by release scripts project(KTextEditor VERSION ${KF5_VERSION}) # ECM setup diff --git a/src/syntax/katehighlight.cpp b/src/syntax/katehighlight.cpp --- a/src/syntax/katehighlight.cpp +++ b/src/syntax/katehighlight.cpp @@ -115,6 +115,15 @@ */ auto definitions = definition().includedDefinitions(); + // it's possible to not have any defintions with malformed file + if (definitions.isEmpty()) { + m_properties.resize(1); + m_propertiesForFormat.push_back(&m_properties[0]); + m_formats.resize(1); + m_formatsIdToIndex.insert(std::make_pair(m_formats[0].id(), 0)); + return; + } + /** * first: handle only really included definitions */ @@ -251,7 +260,9 @@ { // WE ATM assume ascending offset order Q_ASSERT(m_textLineToHighlight); - Q_ASSERT(format.isValid()); + if (!format.isValid()) { + return; + } // get internal attribute, must exist const auto it = m_formatsIdToIndex.find(format.id());