forked from qt-creator/qt-creator
TextEditor: Avoid running hover handlers for same request
...in case the current run is not yet finished. Change-Id: Id78db576ad8fad10af6b21c73e5b47b49d58d26b Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -313,6 +313,9 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isCheckRunning(documentRevision, position))
|
||||||
|
return;
|
||||||
|
|
||||||
// Cancel currently running checks
|
// Cancel currently running checks
|
||||||
for (BaseHoverHandler *handler : m_handlers)
|
for (BaseHoverHandler *handler : m_handlers)
|
||||||
handler->abort();
|
handler->abort();
|
||||||
@@ -331,6 +334,13 @@ public:
|
|||||||
checkNext();
|
checkNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isCheckRunning(int documentRevision, int position) const
|
||||||
|
{
|
||||||
|
return m_currentHandlerIndex <= m_handlers.size()
|
||||||
|
&& m_documentRevision == documentRevision
|
||||||
|
&& m_position == position;
|
||||||
|
}
|
||||||
|
|
||||||
void checkNext()
|
void checkNext()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_currentHandlerIndex < m_handlers.size(), return);
|
QTC_ASSERT(m_currentHandlerIndex < m_handlers.size(), return);
|
||||||
|
Reference in New Issue
Block a user