mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03: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: https://github.com/SerenityOS/serenity/commit/8419eef85e7 Pull-request: https://github.com/SerenityOS/serenity/pull/9790 Reviewed-by: https://github.com/alimpfard ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅
@ -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…
Reference in New Issue
Block a user