Commit Graph

25 Commits (06d0f33c9469f8be016e66064bcdba41416fde3d)

Author SHA1 Message Date
adiabatic 69acf66cd8
Add curly single and double quotes to BRACKETS (#10971) 2024-06-18 10:40:19 +02:00
Krishan 2301430e37
fix match bracket matching (#10777) 2024-05-16 13:50:01 -05:00
Pascal Kuthe 5b8b2f4b9b
improve match bracket matching (#10613) 2024-05-07 09:26:04 -05:00
woojiq 81dc8e8d6b feat: find closest pair using tree-sitter 2024-04-24 16:36:13 -04:00
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.
2024-01-28 18:13:33 +09:00
Pascal Kuthe 445f7a273a ignore empty TS nodes in match bracket 2024-01-15 15:32:07 +09:00
Pascal Kuthe 2fb7e50b54 don't crash in plaintext bracket match (mm) on empty file 2024-01-15 15:32:07 +09:00
Philipp Mildenberger 8a28f30593
Reformat with nightly rustfmt for better let-else formatting (#7721) 2023-07-27 11:57:19 +09:00
Pascal Kuthe a0359f7f22 make TS matching fallback to plaintext 2023-06-22 16:00:08 +09:00
Pascal Kuthe 5dba649d81 Avoid false positives in non-fuzzy bracket match 2023-06-22 16:00:08 +09:00
Pascal Kuthe 37058e0401 match pairs which don't form a standalone TS node 2023-06-22 16:00:08 +09:00
Alex Vinyals a2b8cfdb8c
feat(core): add plaintext matching fallback to tree-sitter matching (#4288) 2023-06-05 23:13:00 +09:00
Stuart Hinson 02f24e1214
Fix match brackets comment (#1346) 2021-12-24 07:27:31 +05:30
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
2021-11-20 23:17:25 +09:00
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.
2021-11-08 09:57:26 +09:00
Cor Peters ac3c1719c9
Fixes crash on empty rust file. (#592)
Fixes #591

Co-authored-by: Cor Peters <luctius@gmail.com>
2021-08-16 19:18:23 +09:00
Nathan Vegdahl ffb8057a7f Fix ocassional panic when matching brackets. 2021-07-22 18:47:37 -07:00
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.
2021-07-01 19:06:52 -07:00
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.
2021-07-01 19:06:52 -07:00
notoria 2bb71a829e
Don't panic on empty file/buffer (#108) 2021-06-05 13:00:43 +09:00
notoria f76f44c8af Convert byte index to char index for `find` 2021-06-04 10:00:22 +09:00
notoria 4fe654cf9a Fix match_brackets::find 2021-06-03 10:35:17 +02:00
Blaž Hrastnik ad3325db8e minor: Remove a few unwraps. 2021-03-26 11:03:14 +09:00
Blaž Hrastnik 06aca7691c clippy lint 2021-03-24 14:58:01 +09:00
Blaž Hrastnik 73c92a0bc1 Implement m / match_brackets (using tree sitter). 2021-03-22 17:58:49 +09:00