diff --git a/src/render/katerenderer.cpp b/src/render/katerenderer.cpp --- a/src/render/katerenderer.cpp +++ b/src/render/katerenderer.cpp @@ -565,10 +565,14 @@ currentViewLine = range->viewLineForColumn(cursor->column()); } + bool foobar = (currentViewLine >= 0) ? true : false; + paintTextLineBackground(paint, range, currentViewLine, xStart, xEnd); if (range->layout()) { bool drawSelection = m_view && m_view->selection() && showSelections() && m_view->selectionRange().overlapsLine(range->line()); + foobar = foobar || drawSelection; + // Draw selection in block selection mode. We need 2 kinds of selections that QTextLayout::draw can't render: // - past-end-of-line selection and // - 0-column-wide selection (used to indicate where text will be typed) @@ -710,7 +714,7 @@ } // draw tab stop indicators - if (showTabs()) { + if (showTabs() || foobar) { int tabIndex = text.indexOf(tabChar, line.lineLayout().xToCursor(xStart)); while (tabIndex != -1 && tabIndex < line.endCol()) { int x = line.lineLayout().cursorToX(tabIndex); @@ -723,7 +727,7 @@ } // draw trailing spaces - if (showTrailingSpaces()) { + if (showTrailingSpaces() || foobar) { int spaceIndex = line.endCol() - 1; int trailingPos = range->textLine()->lastChar(); if (trailingPos < 0) { @@ -743,7 +747,7 @@ } } - if (showNonPrintableSpaces()) { + if (showNonPrintableSpaces() || foobar) { const int y = lineHeight() * i + fm.ascent(); static const QRegularExpression nonPrintableSpacesRegExp(QStringLiteral("[\\x{2000}-\\x{200F}\\x{2028}-\\x{202F}\\x{205F}-\\x{2064}\\x{206A}-\\x{206F}]"));