mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
MdTab: fix focus issue when toggling edit mode in a note without outline
This commit is contained in:
parent
93d2001519
commit
b7fa135956
@ -266,12 +266,13 @@ void VMdTab::showFileEditMode()
|
|||||||
// 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 = 10;
|
int nrRetry = 10;
|
||||||
while (header.m_index > -1
|
do {
|
||||||
&& nrRetry-- > 0
|
// We still need to wait even when there is no header to scroll since
|
||||||
&& (m_outline.isEmpty() || m_outline.getType() != VTableOfContentType::BlockNumber)) {
|
// setCurrentMode()'s sendPostedEvents().
|
||||||
qDebug() << "wait another 100 ms for editor's headers ready";
|
|
||||||
VUtils::sleepWait(100);
|
VUtils::sleepWait(100);
|
||||||
}
|
} while (header.m_index > -1
|
||||||
|
&& nrRetry-- >= 0
|
||||||
|
&& (m_outline.isEmpty() || m_outline.getType() != VTableOfContentType::BlockNumber));
|
||||||
|
|
||||||
scrollEditorToHeader(header, false);
|
scrollEditorToHeader(header, false);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user