aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorKirawi2021-08-22 02:15:33 +0000
committerGitHub2021-08-22 02:15:33 +0000
commit59e0ceef8c764950199a7e6874e15150ba329af3 (patch)
tree0e27fc031824a6ce0737e55c14356e1f91b03f15 /helix-term
parentf9375f449c8b7bbf792c88b89903fe38d524f2e5 (diff)
better panic messages for when you're missing selection scopes (#608)
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/ui/editor.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index d01d08e8..4da8bfd5 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -195,7 +195,9 @@ impl EditorView {
.find_scope_index("diagnostic")
.or_else(|| theme.find_scope_index("ui.cursor"))
.or_else(|| theme.find_scope_index("ui.selection"))
- .expect("no selection scope found!");
+ .expect(
+ "at least one of the following scopes must be defined in the theme: `diagnostic`, `ui.cursor`, or `ui.selection`",
+ );
doc.diagnostics()
.iter()
@@ -220,7 +222,7 @@ impl EditorView {
let selection_scope = theme
.find_scope_index("ui.selection")
- .expect("no selection scope found!");
+ .expect("could not find `ui.selection` scope in the theme!");
let base_cursor_scope = theme
.find_scope_index("ui.cursor")
.unwrap_or(selection_scope);