summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/AbstractView.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-10-31 21:23:01 +0100
committerAndreas Kling <kling@serenityos.org>2020-11-01 10:39:37 +0100
commite499b0f161268ac654d4f288bd9ea3a7d8207c4a (patch)
tree0bc98d8573eff87d629dc3704b2a37f316ebc053 /Libraries/LibGUI/AbstractView.cpp
parent90a30f694db94f7e2ac128e68983a0017b87ea39 (diff)
downloadserenity-e499b0f161268ac654d4f288bd9ea3a7d8207c4a.zip
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.
Diffstat (limited to 'Libraries/LibGUI/AbstractView.cpp')
-rw-r--r--Libraries/LibGUI/AbstractView.cpp1
1 files changed, 1 insertions, 0 deletions
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 {