on master help sign in
Match in visual use head not anchor (#1805)

Currently match is finding the match based on the anchor rather than the head (cursor) so this behavior is rather unexpected when user is doing a match but a different item was matched instead when the selection is more than one character.

commit3d76fa0b81c3f5cef7a8acdfa92b26004e610752 authorIvan Tham <pickfire@riseup.net> dateMon 14 Mar 2022, 10:45 (5 years ago) parent43fc073
1 file changed+1−1
helix-term/src/commands.rs+1−1
helix-term/src/commands.rs+1−1
@@ -3702,7 +3702,7 @@ fn match_brackets(cx: &mut Context) {
37023702 let text = doc.text().slice(..);
37033703 let selection = doc.selection(view.id).clone().transform(|range| {
37043704 if let Some(pos) =
3705− match_brackets::find_matching_bracket_fuzzy(syntax, doc.text(), range.anchor)
3705+ match_brackets::find_matching_bracket_fuzzy(syntax, doc.text(), range.cursor(text))
37063706 {
37073707 range.put_cursor(text, pos, doc.mode == Mode::Select)
37083708 } else {