mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
bug-fix: can not jump to the correct header when first enter edit mode
This commit is contained in:
parent
89375680b4
commit
adacaef1c7
@ -234,8 +234,10 @@ void VMdTab::showFileEditMode()
|
|||||||
// If editor is not init, we need to wait for it to init headers.
|
// If editor is not init, we need to wait for it to init headers.
|
||||||
// Generally, beginEdit() will generate the headers. Wait is needed when
|
// Generally, beginEdit() will generate the headers. Wait is needed when
|
||||||
// highlight completion is going to re-generate the headers.
|
// highlight completion is going to re-generate the headers.
|
||||||
int nrRetry = 5;
|
int nrRetry = 10;
|
||||||
while (header.m_index > -1 && m_outline.isEmpty() && nrRetry-- > 0) {
|
while (header.m_index > -1
|
||||||
|
&& nrRetry-- > 0
|
||||||
|
&& (m_outline.isEmpty() || m_outline.getType() != VTableOfContentType::BlockNumber)) {
|
||||||
qDebug() << "wait another 100 ms for editor's headers ready";
|
qDebug() << "wait another 100 ms for editor's headers ready";
|
||||||
VUtils::sleepWait(100);
|
VUtils::sleepWait(100);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user