summaryrefslogtreecommitdiff
path: root/src/highlighter_group.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-03-20 05:35:15 +1100
committerMaxime Coste <mawww@kakoune.org>2018-03-20 05:35:15 +1100
commit56237aa8f8adaffc63584a6e8435b9cf414d82ef (patch)
tree08630a906d5bf3b60f452246f23fa5fdda1d9deb /src/highlighter_group.cc
parente444cd393785c5a0d7fd62c36d727fe15170ab4c (diff)
Throw when trying to remove a child highlighter that does not exists
Diffstat (limited to 'src/highlighter_group.cc')
-rw-r--r--src/highlighter_group.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/highlighter_group.cc b/src/highlighter_group.cc
index 1b3ba415..01a62e9c 100644
--- a/src/highlighter_group.cc
+++ b/src/highlighter_group.cc
@@ -39,6 +39,8 @@ void HighlighterGroup::add_child(HighlighterAndId&& hl)
void HighlighterGroup::remove_child(StringView id)
{
+ if (not m_highlighters.contains(id))
+ throw runtime_error{format("no such child: {}", id)};
m_highlighters.remove(id);
}