Fix pasting all from empty register
Raise an error if the register is empty for paste-all Fixes #4414
This commit is contained in:
parent
d2e2caaae6
commit
8299d1da1f
|
@ -720,6 +720,9 @@ void paste_all(Context& context, NormalParams params)
|
|||
offsets.push_back(all.length());
|
||||
}
|
||||
|
||||
if (offsets.empty())
|
||||
throw runtime_error("nothing to paste");
|
||||
|
||||
Buffer& buffer = context.buffer();
|
||||
Vector<Selection> result;
|
||||
auto& selections = context.selections();
|
||||
|
|
1
test/regression/4414-crash-on-paste-all/cmd
Normal file
1
test/regression/4414-crash-on-paste-all/cmd
Normal file
|
@ -0,0 +1 @@
|
|||
<a-p>
|
1
test/regression/4414-crash-on-paste-all/in
Normal file
1
test/regression/4414-crash-on-paste-all/in
Normal file
|
@ -0,0 +1 @@
|
|||
|
1
test/regression/4414-crash-on-paste-all/out
Normal file
1
test/regression/4414-crash-on-paste-all/out
Normal file
|
@ -0,0 +1 @@
|
|||
|
Loading…
Reference in New Issue
Block a user