mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
fix outline bug in edit mode
Avoid taking the # in code block as a header by mistake. Signed-off-by: Le Tan <tamlokveer@gmail.com>
This commit is contained in:
parent
201d14116f
commit
d77b333343
@ -180,7 +180,8 @@ void VEdit::generateEditOutline()
|
|||||||
QRegExp headerReg("(#{1,6})\\s*(\\S.*)"); // Need to trim the spaces
|
QRegExp headerReg("(#{1,6})\\s*(\\S.*)"); // Need to trim the spaces
|
||||||
for (QTextBlock block = doc->begin(); block != doc->end(); block = block.next()) {
|
for (QTextBlock block = doc->begin(); block != doc->end(); block = block.next()) {
|
||||||
Q_ASSERT(block.lineCount() == 1);
|
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(),
|
VHeader header(headerReg.cap(1).length(),
|
||||||
headerReg.cap(2).trimmed(), "", block.firstLineNumber());
|
headerReg.cap(2).trimmed(), "", block.firstLineNumber());
|
||||||
headers.append(header);
|
headers.append(header);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user