1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 00:15:08 +00:00

LibGUI: Invalidate view cursor on model update

This is sad (since it would be nice to preserve the cursor+selection)
but until we implement persistent model indexes, this at least prevents
us from keeping a stale cursor index.
This commit is contained in:
Andreas Kling 2020-10-31 21:23:01 +01:00
parent 90a30f694d
commit e499b0f161

View file

@ -73,6 +73,7 @@ void AbstractView::did_update_model(unsigned flags)
stop_editing();
m_edit_index = {};
m_hovered_index = {};
m_cursor_index = {};
if (!model() || (flags & GUI::Model::InvalidateAllIndexes)) {
clear_selection();
} else {