mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:18:11 +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:
parent
d0e44993a1
commit
8419eef85e
1 changed files with 4 additions and 0 deletions
|
@ -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 = {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue