mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-23 23:34:12 +03:00
Detect empty selection lists when restoring selections from registers
Fixes #1123
This commit is contained in:
parent
394b962524
commit
8c55acb076
@ -1436,6 +1436,9 @@ SelectionList read_selections_from_register(char reg, Context& context)
|
||||
for (auto sel_desc : StringView{desc.begin(), arobase} | split<StringView>(':'))
|
||||
sels.push_back(selection_from_string(sel_desc));
|
||||
|
||||
if (sels.empty())
|
||||
throw runtime_error(format("Register {} contains an empty selection list", reg));
|
||||
|
||||
return {buffer, std::move(sels), timestamp};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user