mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
VMdTab: do not change the cursor if it is below the right title when entering the read mode
This commit is contained in:
parent
6ba12f7932
commit
3f3a0e8513
@ -165,6 +165,15 @@ bool VMdTab::scrollEditorToHeader(const VHeaderPointer &p_header)
|
||||
}
|
||||
}
|
||||
|
||||
// If the cursor are now under the right title, we should not change it right at
|
||||
// the title.
|
||||
int curBlockNumber = mdEdit->textCursor().block().blockNumber();
|
||||
if (m_outline.indexOfItemByBlockNumber(curBlockNumber)
|
||||
== m_outline.indexOfItemByBlockNumber(blockNumber)) {
|
||||
m_currentHeader = p_header;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mdEdit->scrollToHeader(blockNumber)) {
|
||||
m_currentHeader = p_header;
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user