highlighter init delay
This commit is contained in:
parent
f26acb8482
commit
5a1cdae07c
|
@ -18,9 +18,7 @@
|
|||
#include "fileiconprovider.h"
|
||||
#include "settings.h"
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
const int ANDROID_INIT_HIGHLIGHTER_DELAY = 100;
|
||||
#endif
|
||||
const int INIT_HIGHLIGHTER_DELAY = 100;
|
||||
|
||||
EditorTabs::EditorTabs(QTabWidget * widget):
|
||||
tabWidget(widget)
|
||||
|
@ -135,14 +133,12 @@ void EditorTabs::createTab(QString filepath, bool initHighlight)
|
|||
|
||||
emit tabOpened(tabIndex);
|
||||
if (initHighlight) {
|
||||
#if defined(Q_OS_ANDROID)
|
||||
//editor->initHighlighter();
|
||||
// let it scroll to requested line first
|
||||
Editor * currentEditor = editor;
|
||||
QTimer::singleShot(ANDROID_INIT_HIGHLIGHTER_DELAY, currentEditor, ([currentEditor](){
|
||||
QTimer::singleShot(INIT_HIGHLIGHTER_DELAY, currentEditor, ([currentEditor](){
|
||||
currentEditor->initHighlighter();
|
||||
}));
|
||||
#else
|
||||
editor->initHighlighter();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue