forked from qt-creator/qt-creator
TextEditor: only paint selections in the first block of a suggestion
Fixes highlighting of matching parentheses or errors of the code model in every line of the suggestion. Change-Id: I223cb567ee8ce95badd91c4819417310a0e28cff Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -4994,7 +4994,13 @@ void TextEditorWidget::paintBlock(QPainter *painter,
|
|||||||
QPointF replacementOffset = offset;
|
QPointF replacementOffset = offset;
|
||||||
replacementOffset.rx() += document()->documentMargin();
|
replacementOffset.rx() += document()->documentMargin();
|
||||||
while (replacementBlock.isValid()) {
|
while (replacementBlock.isValid()) {
|
||||||
replacementBlock.layout()->draw(painter, replacementOffset, selections, clipRect);
|
const QVector<QTextLayout::FormatRange> blockSelections
|
||||||
|
= replacementBlock.blockNumber() == 0 ? selections
|
||||||
|
: QVector<QTextLayout::FormatRange>{};
|
||||||
|
replacementBlock.layout()->draw(painter,
|
||||||
|
replacementOffset,
|
||||||
|
blockSelections,
|
||||||
|
clipRect);
|
||||||
replacementOffset.ry()
|
replacementOffset.ry()
|
||||||
+= replacement->documentLayout()->blockBoundingRect(replacementBlock).height();
|
+= replacement->documentLayout()->blockBoundingRect(replacementBlock).height();
|
||||||
replacementBlock = replacementBlock.next();
|
replacementBlock = replacementBlock.next();
|
||||||
|
|||||||
Reference in New Issue
Block a user