diff --git a/src/vedit.cpp b/src/vedit.cpp index 94f90d10..b669b638 100644 --- a/src/vedit.cpp +++ b/src/vedit.cpp @@ -180,7 +180,8 @@ void VEdit::generateEditOutline() QRegExp headerReg("(#{1,6})\\s*(\\S.*)"); // Need to trim the spaces for (QTextBlock block = doc->begin(); block != doc->end(); block = block.next()) { Q_ASSERT(block.lineCount() == 1); - if (headerReg.exactMatch(block.text())) { + if ((block.userState() == HighlightBlockState::BlockNormal) && + headerReg.exactMatch(block.text())) { VHeader header(headerReg.cap(1).length(), headerReg.cap(2).trimmed(), "", block.firstLineNumber()); headers.append(header);