From a0359f7f22d26548d5680fb1dc177f6d4b07ad11 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Tue, 6 Jun 2023 01:48:36 +0200 Subject: make TS matching fallback to plaintext --- helix-term/src/ui/editor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'helix-term/src/ui/editor.rs') 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)]; -- cgit v1.2.3-70-g09d2