Fix pasting all from empty register

Raise an error if the register is empty for paste-all

Fixes #4414
This commit is contained in:
Maxime Coste 2021-11-01 09:05:57 +11:00
parent d2e2caaae6
commit 8299d1da1f
4 changed files with 6 additions and 0 deletions

View File

@ -720,6 +720,9 @@ void paste_all(Context& context, NormalParams params)
offsets.push_back(all.length()); offsets.push_back(all.length());
} }
if (offsets.empty())
throw runtime_error("nothing to paste");
Buffer& buffer = context.buffer(); Buffer& buffer = context.buffer();
Vector<Selection> result; Vector<Selection> result;
auto& selections = context.selections(); auto& selections = context.selections();

View File

@ -0,0 +1 @@
<a-p>

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@