forked from qt-creator/qt-creator
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:
@@ -111,6 +111,7 @@ public:
|
|||||||
bool addMark(TextMark *mark);
|
bool addMark(TextMark *mark);
|
||||||
TextMarks marksAt(int line) const;
|
TextMarks marksAt(int line) const;
|
||||||
void removeMark(TextMark *mark);
|
void removeMark(TextMark *mark);
|
||||||
|
void updateLayout() const;
|
||||||
void updateMark(TextMark *mark);
|
void updateMark(TextMark *mark);
|
||||||
void moveMark(TextMark *mark, int previousLine);
|
void moveMark(TextMark *mark, int previousLine);
|
||||||
void removeMarkFromMarksCache(TextMark *mark);
|
void removeMarkFromMarksCache(TextMark *mark);
|
||||||
@@ -187,7 +188,6 @@ private:
|
|||||||
void cleanWhitespace(QTextCursor &cursor, bool inEntireDocument, bool cleanIndentation);
|
void cleanWhitespace(QTextCursor &cursor, bool inEntireDocument, bool cleanIndentation);
|
||||||
void ensureFinalNewLine(QTextCursor &cursor);
|
void ensureFinalNewLine(QTextCursor &cursor);
|
||||||
void modificationChanged(bool modified);
|
void modificationChanged(bool modified);
|
||||||
void updateLayout() const;
|
|
||||||
|
|
||||||
TextDocumentPrivate *d;
|
TextDocumentPrivate *d;
|
||||||
};
|
};
|
||||||
|
@@ -242,13 +242,14 @@ void TextMark::removedFromEditor()
|
|||||||
void TextMark::updateMarker()
|
void TextMark::updateMarker()
|
||||||
{
|
{
|
||||||
if (m_baseTextDocument)
|
if (m_baseTextDocument)
|
||||||
m_baseTextDocument->updateMark(this);
|
m_baseTextDocument->updateLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextMark::setPriority(TextMark::Priority prioriy)
|
void TextMark::setPriority(TextMark::Priority prioriy)
|
||||||
{
|
{
|
||||||
m_priority = prioriy;
|
m_priority = prioriy;
|
||||||
updateMarker();
|
if (m_baseTextDocument)
|
||||||
|
m_baseTextDocument->updateMark(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextMark::isVisible() const
|
bool TextMark::isVisible() const
|
||||||
|
Reference in New Issue
Block a user