diff --git a/app/src/UI/Widgets/Terminal.cpp b/app/src/UI/Widgets/Terminal.cpp index 1c46f536..1ed25ca7 100644 --- a/app/src/UI/Widgets/Terminal.cpp +++ b/app/src/UI/Widgets/Terminal.cpp @@ -181,15 +181,13 @@ void Widgets::Terminal::paint(QPainter *painter) // Check if this line is within the selection range bool lineFullySelected = !m_selectionEnd.isNull() && i >= m_selectionStart.y() - && i <= m_selectionEnd.y(); + && i < m_selectionEnd.y(); // Handle empty lines if (line.isEmpty()) { // Draw selection rectangle if required for this line - if (lineFullySelected - || (!m_selectionEnd.isNull() && i >= m_selectionStart.y() - && i <= m_selectionEnd.y())) + if (lineFullySelected) { QRect selectionRect(m_borderX, y, width() - 2 * m_borderX, m_cHeight); painter->fillRect(selectionRect, m_palette.color(QPalette::Highlight));