Skip to content

Commit 3d76fa0

Browse files
authored
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.
1 parent 43fc073 commit 3d76fa0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

helix-term/src/commands.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -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 {

0 commit comments

Comments
 (0)