From f2fb5a3214612fb35f89ad552ee75ef4bb0dde4c Mon Sep 17 00:00:00 2001 From: Olivier Perret Date: Thu, 3 Dec 2020 21:42:14 +0100 Subject: [PATCH] Throw no_selections_remaining when using This makes it possible to use the mechanism introduced by 91386a53 --- src/normal.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/normal.cc b/src/normal.cc index 618c0008..fba39d17 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -2106,7 +2106,7 @@ void remove_selection(Context& context, NormalParams p) if (index >= selections.size()) throw runtime_error{format("invalid selection index: {}", index)}; if (selections.size() == 1) - throw runtime_error{"cannot remove the last selection"}; + throw no_selections_remaining{}; selections.remove(index); selections.check_invariant();