summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2021-11-01 09:05:57 +1100
committerMaxime Coste <mawww@kakoune.org>2021-11-01 09:05:57 +1100
commit8299d1da1f4e3fd856dc81ff1c8ec584714582e0 (patch)
treeafd2358051991b6cfe76931d41c5277adb971bed /src
parentd2e2caaae6119b5abc2aca3a95e2da7db547eac3 (diff)
Fix pasting all from empty register
Raise an error if the register is empty for paste-all Fixes #4414
Diffstat (limited to 'src')
-rw-r--r--src/normal.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 64daabc6..8d2ed82c 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -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();