goto_word: Reject jump label characters with modifiers

Previously you could use `<A-a><A-b>` to jump to a label "ab". We should
not treat characters with modifiers the same as characters without.
With this change the `<A-a>` input exits out of the jumping on-next-key.

Fixes #12695
pull/11492/merge
Michael Davis 2025-01-27 08:49:03 -05:00
parent b00b475dfe
commit f5f9f499cf
No known key found for this signature in database
1 changed files with 1 additions and 0 deletions

View File

@ -6488,6 +6488,7 @@ fn jump_to_label(cx: &mut Context, labels: Vec<Range>, behaviour: Movement) {
let alphabet = &cx.editor.config().jump_label_alphabet; let alphabet = &cx.editor.config().jump_label_alphabet;
let Some(i) = event let Some(i) = event
.char() .char()
.filter(|_| event.modifiers.is_empty())
.and_then(|ch| alphabet.iter().position(|&it| it == ch)) .and_then(|ch| alphabet.iter().position(|&it| it == ch))
else { else {
doc_mut!(cx.editor, &doc).remove_jump_labels(view); doc_mut!(cx.editor, &doc).remove_jump_labels(view);