From e499b0f161268ac654d4f288bd9ea3a7d8207c4a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 31 Oct 2020 21:23:01 +0100 Subject: [PATCH] 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. --- Libraries/LibGUI/AbstractView.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/LibGUI/AbstractView.cpp b/Libraries/LibGUI/AbstractView.cpp index e6a169fcb7..e2ed2c9698 100644 --- a/Libraries/LibGUI/AbstractView.cpp +++ b/Libraries/LibGUI/AbstractView.cpp @@ -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 {