1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-24 20:13:00 +03:00

Detect empty selection lists when restoring selections from registers

Fixes #1123
This commit is contained in:
Maxime Coste 2017-01-11 13:43:41 +00:00
parent 394b962524
commit 8c55acb076

View File

@ -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};
}