Skip to content

Commit

Permalink
better panic messages for when you're missing selection scopes (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirawi authored Aug 22, 2021
1 parent f9375f4 commit 59e0cee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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);
Expand Down

0 comments on commit 59e0cee

Please sign in to comment.