mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 01:46:29 +00:00
shada: fix failed assertion on exit (#12692)
If set the number of history saves is 0, assertions fail when inserting an entry on exit. Dont insert an entry when the number of saves is 0 fixes the issue. fixes #11497
This commit is contained in:
@@ -2207,8 +2207,12 @@ static inline ShaDaWriteResult shada_read_when_writing(
|
||||
shada_free_shada_entry(&entry);
|
||||
break;
|
||||
}
|
||||
hms_insert(&wms->hms[entry.data.history_item.histtype], entry, true,
|
||||
true);
|
||||
if (wms->hms[entry.data.history_item.histtype].hmll.size != 0) {
|
||||
hms_insert(&wms->hms[entry.data.history_item.histtype], entry, true,
|
||||
true);
|
||||
} else {
|
||||
shada_free_shada_entry(&entry);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kSDItemRegister: {
|
||||
|
Reference in New Issue
Block a user