diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 05b4d8796bf..d9bf38688ac 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -3286,8 +3286,10 @@ QStandardItem *StringSelectionAspect::itemById(const QString &id) void StringSelectionAspect::bufferToGui() { - if (!m_model) + if (!m_model) { + m_undoable.setSilently(m_buffer); return; + } auto selected = itemById(m_buffer); if (selected) { @@ -3302,8 +3304,10 @@ void StringSelectionAspect::bufferToGui() m_selectionModel->setCurrentIndex(m_model->item(0)->index(), QItemSelectionModel::SelectionFlag::ClearAndSelect); } else { + m_undoable.setSilently(m_buffer); m_selectionModel->setCurrentIndex(QModelIndex(), QItemSelectionModel::SelectionFlag::Clear); } + handleGuiChanged(); }