From dfd2c5dbc381ae4bb630e888a5f03fd39926a54b Mon Sep 17 00:00:00 2001
From: mae <qt-info@nokia.com>
Date: Thu, 23 Apr 2009 20:11:00 +0200
Subject: [PATCH] small block highlighting cleanup for the no-wrapping case
 with overlong lines

---
 src/plugins/texteditor/basetexteditor.cpp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 7dcfcf5679c..e821bce1239 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -1746,11 +1746,11 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
         painter.fillRect(QRectF(lineX, 0, viewportRect.width() - lineX, viewportRect.height()), blendColor);
     }
     
-    // keep right margin clean from full-width selection
-    int maxX = offset.x() + qMax((qreal)viewportRect.width(), documentLayout->documentSize().width())
-               - doc->documentMargin();
-    er.setRight(qMin(er.right(), maxX));
-    painter.setClipRect(er);
+//    // keep right margin clean from full-width selection
+//    int maxX = offset.x() + qMax((qreal)viewportRect.width(), documentLayout->documentSize().width())
+//               - doc->documentMargin();
+//    er.setRight(qMin(er.right(), maxX));
+//    painter.setClipRect(er);
 
     bool editable = !isReadOnly();
 
@@ -1804,9 +1804,11 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
 
             int count = d->m_highlightBlocksInfo.visualIndent.size();
             if (count) {
+                QRectF rr = r;
+                rr.setWidth(viewport()->width());
                 for(int i = 0; i <= depth; ++i) {
                     int vi = i > 0 ? d->m_highlightBlocksInfo.visualIndent.at(i-1) : 0;
-                    painter.fillRect(r.adjusted(vi, 0, 0, 0), calcBlendColor(baseColor, count - i));
+                    painter.fillRect(rr.adjusted(vi, 0, -8*i, 0), calcBlendColor(baseColor, count - i));
                 }
             }
         }
-- 
GitLab