diff options
Diffstat (limited to 'helix-term')
-rw-r--r-- | helix-term/src/commands.rs | 4 | ||||
-rw-r--r-- | helix-term/src/ui/editor.rs | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 2c9295f1..1bd73652 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -4649,8 +4649,8 @@ fn match_brackets(cx: &mut Context) { let selection = doc.selection(view.id).clone().transform(|range| { let pos = range.cursor(text_slice); if let Some(matched_pos) = doc.syntax().map_or_else( - || match_brackets::find_matching_bracket_current_line_plaintext(text, pos), - |syntax| match_brackets::find_matching_bracket_fuzzy(syntax, text, pos), + || match_brackets::find_matching_bracket_plaintext(text.slice(..), pos), + |syntax| match_brackets::find_matching_bracket_fuzzy(syntax, text.slice(..), pos), ) { range.put_cursor(text_slice, matched_pos, is_select) } else { diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 16940e33..5b5cda93 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -501,7 +501,9 @@ impl EditorView { use helix_core::match_brackets; let pos = doc.selection(view.id).primary().cursor(text); - if let Some(pos) = match_brackets::find_matching_bracket(syntax, doc.text(), pos) { + if let Some(pos) = + match_brackets::find_matching_bracket(syntax, doc.text().slice(..), pos) + { // ensure col is on screen if let Some(highlight) = theme.find_scope_index_exact("ui.cursor.match") { return vec![(highlight, pos..pos + 1)]; |