summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorDawid Wolosowicz <d@1823.pl>2021-09-04 15:21:15 +0200
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-09-08 15:48:02 +0430
commit8419eef85e770dc06a94a264b7860832e54c6a96 (patch)
treee812591d20d5bf73f107a608009b58a3612314c5 /Userland
parentd0e44993a10201a7282e3d4b362f5d2c41ac7611 (diff)
downloadserenity-8419eef85e770dc06a94a264b7860832e54c6a96.zip
LibGUI: Sync the highlighting after each model update
Without this, the highlighting would stay on the initial index even if the matching row is no longer there.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGUI/AbstractView.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/AbstractView.cpp b/Userland/Libraries/LibGUI/AbstractView.cpp
index fd635eda63..e98f62669d 100644
--- a/Userland/Libraries/LibGUI/AbstractView.cpp
+++ b/Userland/Libraries/LibGUI/AbstractView.cpp
@@ -72,6 +72,10 @@ void AbstractView::model_did_update(unsigned int flags)
if (!model()->is_within_range(m_drop_candidate_index))
m_drop_candidate_index = {};
selection().remove_matching([this](auto& index) { return !model()->is_within_range(index); });
+
+ auto index = find_next_search_match(m_highlighted_search.view());
+ if (index.is_valid())
+ highlight_search(index);
}
m_selection_start_index = {};
}