1
0
mirror of https://github.com/helix-editor/helix synced 2026-03-23 14:11:55 +01:00
helix/helix-core
Ryan Mehri a27d192db6
fix: freeze in markdown when matching brackets (#15351)
Previously, for a nested set of pairs in Markdown such as:

```markdown
[foo "bar" b|az]
[foo (bar) b|az]
```

Trying to do `mam` or similar would freeze.

The generated parse tree for the former looks like this:

```
0:0  - 1:0    inline
0:0  - 0:15     shortcut_link
0:0  - 0:1        "["
0:1  - 0:14       link_text
0:5  - 0:6          """
0:9  - 0:10         """
0:14 - 0:15       "]"
```

The node surrounding the cursor is `link_text` and it has two children
`"` but these are outside of the cursor, so we don't want to select them.
This change makes it so we check that `pos_` is within the `open` and
`close` node range so that we don't get stuck in a loop of finding
the same `"` pair.
2026-03-14 14:00:11 -05:00
..
src fix: freeze in markdown when matching brackets (#15351) 2026-03-14 14:00:11 -05:00
tests Fix clippy lints for more recent Rust versions in tests 2026-01-25 13:59:06 -05:00
.gitignore
Cargo.toml