Editor: skip unnecessary text mark priority reevaluation

Only remove and add the text mark to the text block user data if the
priority changed. In all other cases a layout update is sufficient.

Amends a8cad01887

Change-Id: I9f8552e766838917c0e296cc7f7c7730669c45cd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2022-05-24 09:56:23 +02:00
parent 123a6e61de
commit f35cd3c13f
2 changed files with 4 additions and 3 deletions

View File

@@ -242,13 +242,14 @@ void TextMark::removedFromEditor()
void TextMark::updateMarker()
{
if (m_baseTextDocument)
m_baseTextDocument->updateMark(this);
m_baseTextDocument->updateLayout();
}
void TextMark::setPriority(TextMark::Priority prioriy)
{
m_priority = prioriy;
updateMarker();
if (m_baseTextDocument)
m_baseTextDocument->updateMark(this);
}
bool TextMark::isVisible() const