Unnamed repository; edit this file 'description' to name the repository.
Fix panic in `goto_word` when `editor.jump-label-alphabet` is empty (#13863)
Tino 8 months ago
parent 6081a5d · commit 6a09047
-rw-r--r--helix-term/src/commands.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 2cbdeb45..38e52e18 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -6728,6 +6728,10 @@ fn jump_to_word(cx: &mut Context, behaviour: Movement) {
// Calculate the jump candidates: ranges for any visible words with two or
// more characters.
let alphabet = &cx.editor.config().jump_label_alphabet;
+ if alphabet.is_empty() {
+ return;
+ }
+
let jump_label_limit = alphabet.len() * alphabet.len();
let mut words = Vec::with_capacity(jump_label_limit);
let (view, doc) = current_ref!(cx.editor);