Closed ddickstein closed 1 year ago
Unfortunately, there is no way to query the syn-keepend
syntax properties, thus there is no way for matchit to guess the proper jump point.
Is this a limitation of searchpair
?
not only searchpair()
. There is no API to query information about what parts of a buffer belong to what syntax group, except for querying each column separately to what syntax item it belongs to.
Yeah, I don't think matchit should be leveraging syntax groups. What I mean is, is there some functionality that is missing in the API to have keepend-like pair navigation, and if not, should/could that be something that searchpair
provided? What would the "necessary and sufficient" need to be here for this to work? I'd like to request it from Bram.
OCaml's definition of
b:match_words
has a bug in the following scenario:The correct pairing here would be
let
on line 1 is paired with the;;
on line 8, thelet
on line 2 is paired with thein
on line 6, and thestruct
on line 2 is paired with theend
on line 5. Matchit incorrectly pairs thelet
on line 3 with the;;
on line 8 and thelet
on line 4 with thein
on line 6. If it supportedsyn-keepend
semantics, we would be able to say thatlet
should not match across an unmatchedend
.