mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-06 06:19:52 +08:00
PegMarkdownHighlighter: tune performance
This commit is contained in:
parent
eaa8d55f66
commit
6793855164
@ -74,7 +74,7 @@ void PegMarkdownHighlighter::init(const QVector<HighlightingStyle> &p_styles,
|
||||
|
||||
m_fastParseTimer = new QTimer(this);
|
||||
m_fastParseTimer->setSingleShot(true);
|
||||
m_fastParseTimer->setInterval(50);
|
||||
m_fastParseTimer->setInterval(100);
|
||||
connect(m_fastParseTimer, &QTimer::timeout,
|
||||
this, [this]() {
|
||||
startFastParse(m_fastParseInfo.m_position,
|
||||
@ -729,7 +729,7 @@ void PegMarkdownHighlighter::getFastParseBlockRange(int p_position,
|
||||
int &p_firstBlock,
|
||||
int &p_lastBlock) const
|
||||
{
|
||||
const int maxNumOfBlocks = 50;
|
||||
const int maxNumOfBlocks = 10;
|
||||
|
||||
int charsChanged = p_charsRemoved + p_charsAdded;
|
||||
QTextBlock firstBlock = m_doc->findBlock(p_position);
|
||||
|
Loading…
x
Reference in New Issue
Block a user