Skip to content

Commit b71ca92

Browse files
committed
liteeditor, save action clear temp completer items
1 parent dfd362e commit b71ca92

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

liteidex/src/plugins/liteeditor/litecompleter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static void clearTempIndex(QStandardItemModel *model, QModelIndex parent) {
183183
int i = model->rowCount(parent);
184184
while (i--) {
185185
QModelIndex index = model->index(i,0,parent);
186-
if (index.data(WordItem::TempRole).toBool() == true) {
186+
if (index.data(WordItem::TempRole).toBool() == true || index.data(WordItem::KindRole).toString().isEmpty()) {
187187
model->removeRow(i,parent);
188188
} else {
189189
clearTempIndex(model,index);

liteidex/src/plugins/liteeditor/liteeditor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ bool LiteEditor::save()
784784
if (m_bReadOnly) {
785785
return false;
786786
}
787+
m_completer->clearTemp();
787788
return saveAs(m_file->filePath());
788789
}
789790

0 commit comments

Comments
 (0)