From d9b58bb5eb666d53573e2c4eade5c485e7638179 Mon Sep 17 00:00:00 2001 From: GenevensiS <66968533+G-e-n-e-v-e-n-s-i-S@users.noreply.github.com> Date: Fri, 5 Jun 2026 05:08:57 +0200 Subject: [PATCH] Selection highlight debug for linux this is not optimized but it'll do for now --- src/gui/value/text.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/value/text.cpp b/src/gui/value/text.cpp index 5bd24758..6ff30d07 100644 --- a/src/gui/value/text.cpp +++ b/src/gui/value/text.cpp @@ -665,12 +665,13 @@ void TextValueEditor::draw(RotatedDC& dc) { } } -void TextValueEditor::redrawSelection(size_t old_selection_start_i, size_t old_selection_end_i, bool old_drop_down_shown) { +void TextValueEditor::redrawSelection(size_t old_selection_start_i, size_t old_selection_end_i, bool old_drop_down_shown) { // Hide caret if (isCurrent()) { wxCaret* caret = editor().GetCaret(); if (caret->IsVisible()) caret->Hide(); - } + } +#ifdef __WXMSW__ // Destroy the clientDC before reshowing the caret, prevent flicker on MSW { // Move selection @@ -701,7 +702,14 @@ void TextValueEditor::redrawSelection(size_t old_selection_start_i, size_t old_s // redraw drop down indicators drawWordListIndicators(dc, true); } - } + } +#else + scroll_with_cursor = true; + if (ensureCaretVisible()) { + updateScrollbar(); + } + redraw(); +#endif if (isCurrent()) { showCaret(); }