mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09: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
Notes:
sideshowbarker
2024-07-18 04:26:34 +09:00
Author: https://github.com/d1823
Commit: 8419eef85e
Pull-request: https://github.com/SerenityOS/serenity/pull/9790
Reviewed-by: https://github.com/alimpfard ✅
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
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