From adacaef1c783c50493d468f0cd39b42b029bd467 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Fri, 27 Apr 2018 20:35:45 +0800 Subject: [PATCH] bug-fix: can not jump to the correct header when first enter edit mode --- src/vmdtab.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vmdtab.cpp b/src/vmdtab.cpp index 25dffc05..648d8bbc 100644 --- a/src/vmdtab.cpp +++ b/src/vmdtab.cpp @@ -234,8 +234,10 @@ void VMdTab::showFileEditMode() // If editor is not init, we need to wait for it to init headers. // Generally, beginEdit() will generate the headers. Wait is needed when // highlight completion is going to re-generate the headers. - int nrRetry = 5; - while (header.m_index > -1 && m_outline.isEmpty() && nrRetry-- > 0) { + int nrRetry = 10; + 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"; VUtils::sleepWait(100); }