forked from qt-creator/qt-creator
TextEditor: Sort extraSelections
When applied to the QPlainTextEdit, the first selection for a range wins. We want "OtherSelection" which is used for links to win, so we "sort" it to the beginning of the final list. Change-Id: Idf84c92ad5bd12d9f6ad6381f7e556e51ee459a9 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -7825,10 +7825,13 @@ void TextEditorWidgetPrivate::setExtraSelections(Id kind, const QList<QTextEdit:
|
|||||||
}
|
}
|
||||||
m_overlay->setVisible(!m_overlay->isEmpty());
|
m_overlay->setVisible(!m_overlay->isEmpty());
|
||||||
} else {
|
} else {
|
||||||
QList<QTextEdit::ExtraSelection> all;
|
QList<QTextEdit::ExtraSelection> all = m_extraSelections.value(
|
||||||
|
TextEditorWidget::OtherSelection);
|
||||||
|
|
||||||
for (auto i = m_extraSelections.constBegin(); i != m_extraSelections.constEnd(); ++i) {
|
for (auto i = m_extraSelections.constBegin(); i != m_extraSelections.constEnd(); ++i) {
|
||||||
if (i.key() == TextEditorWidget::CodeSemanticsSelection
|
if (i.key() == TextEditorWidget::CodeSemanticsSelection
|
||||||
|| i.key() == TextEditorWidget::SnippetPlaceholderSelection)
|
|| i.key() == TextEditorWidget::SnippetPlaceholderSelection
|
||||||
|
|| i.key() == TextEditorWidget::OtherSelection)
|
||||||
continue;
|
continue;
|
||||||
all += i.value();
|
all += i.value();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user