Commit Graph

21 Commits (daef7fadab4ef03bff91c5c631839177d3f327b2)

Author SHA1 Message Date
Michael Davis 5e0b3cc28b Use injection syntax trees for bracket matching
Previously we used the root syntax tree for bracket matching. We can use
the new functionality in `Syntax` for finding the correct syntax tree
for a given byte range though so we use the correct syntax tree within
injections. This improves bracket matching behavior within HTML
injections like script or style tags for example.
8 months ago
Pascal Kuthe 445f7a273a ignore empty TS nodes in match bracket 9 months ago
Pascal Kuthe 2fb7e50b54 don't crash in plaintext bracket match (mm) on empty file 9 months ago
Philipp Mildenberger 8a28f30593
Reformat with nightly rustfmt for better let-else formatting (#7721) 1 year ago
Pascal Kuthe a0359f7f22 make TS matching fallback to plaintext 1 year ago
Pascal Kuthe 5dba649d81 Avoid false positives in non-fuzzy bracket match 1 year ago
Pascal Kuthe 37058e0401 match pairs which don't form a standalone TS node 1 year ago
Alex Vinyals a2b8cfdb8c
feat(core): add plaintext matching fallback to tree-sitter matching (#4288) 1 year ago
Stuart Hinson 02f24e1214
Fix match brackets comment (#1346) 3 years ago
Martin Junghanns a3a3b0b517
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
3 years ago
Daniel S Poulin 1e793c2bbf
Adds single and double quotes to matching pairs (#995)
This enables `mm` to work on quote characters as well as highlighting of
matching quote when on it.
3 years ago
Cor Peters ac3c1719c9
Fixes crash on empty rust file. (#592)
Fixes #591

Co-authored-by: Cor Peters <luctius@gmail.com>
3 years ago
Nathan Vegdahl ffb8057a7f Fix ocassional panic when matching brackets. 3 years ago
Nathan Vegdahl 220bc85821 Fix all remaining warnings in helix-core except for two.
I'm not sure how to address them, because they look like they
might be bugs, and code is involved.  Will poke the relevant people.
3 years ago
Nathan Vegdahl b571f28641 Remove #[allow(unused)] from helix-core, and fix unused imports.
Still a bunch more warnings to fix in core, but it's a start.
3 years ago
notoria 2bb71a829e
Don't panic on empty file/buffer (#108) 3 years ago
notoria f76f44c8af Convert byte index to char index for `find` 3 years ago
notoria 4fe654cf9a Fix match_brackets::find 3 years ago
Blaž Hrastnik ad3325db8e minor: Remove a few unwraps. 4 years ago
Blaž Hrastnik 06aca7691c clippy lint 4 years ago
Blaž Hrastnik 73c92a0bc1 Implement m / match_brackets (using tree sitter). 4 years ago