mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 06:37:52 +00:00
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.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
d0e44993a1
commit
8419eef85e
@@ -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 = {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user