aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorMartin Junghanns2021-11-20 14:17:25 +0000
committerGitHub2021-11-20 14:17:25 +0000
commita3a3b0b517d0e690f3efc66b17ac7b9f769dba9d (patch)
tree6508de70a21a30b0ac88bbd7d619ac8540a2ac23 /helix-term/src/commands.rs
parentb95c9470de9f9199f109fdbfb6ec9a951fbe8866 (diff)
Jump to end char of surrounding pair from any cursor pos (#1121)
* Jump to end char of surrounding pair from any cursor pos * Separate bracket matching into exact and fuzzy search * Add constants for bracket chars * Abort early if char under cursor is not a bracket * Simplify bracket char validation * Refactor node search and unify find methods * Remove bracket constants
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 431265cd..e70773eb 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -4954,7 +4954,9 @@ fn match_brackets(cx: &mut Context) {
if let Some(syntax) = doc.syntax() {
let text = doc.text().slice(..);
let selection = doc.selection(view.id).clone().transform(|range| {
- if let Some(pos) = match_brackets::find(syntax, doc.text(), range.anchor) {
+ if let Some(pos) =
+ match_brackets::find_matching_bracket_fuzzy(syntax, doc.text(), range.anchor)
+ {
range.put_cursor(text, pos, doc.mode == Mode::Select)
} else {
range