Commit 20c8b60e authored by Christoph Cullmann's avatar Christoph Cullmann 🍨
Browse files

avoid to use previous block that is not there

same logic as in the KSyntaxHighting highligher

CCBUG: 459520
parent 8da75f69
Pipeline #235751 passed with stage
in 5 minutes and 24 seconds
......@@ -39,7 +39,8 @@ void DiffSyntaxHighlighter::highlightBlock(const QString &text)
// when we encounter a hunk to avoid issues like everything
// is commented because previous hunk ended with an unclosed
// comment block
if (m_diffWidget->isHunk(currentBlock().blockNumber())) {
// do this only if not anyways first block, there user data is not existing
if (currentBlock().position() > 0 && m_diffWidget->isHunk(currentBlock().blockNumber())) {
auto prevBlock = currentBlock().previous();
const auto prevData = prevBlock.userData();
delete prevData;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment