tmsvg / pear-tree

A Vim auto-pair plugin that supports multi-character pairs, intelligent matching, and more
MIT License
392 stars 12 forks source link

Fix `not_at` argument with wildcards #32

Closed bryclee closed 5 years ago

bryclee commented 5 years ago

This is a stab at addressing https://github.com/tmsvg/pear-tree/issues/31

Previously, s:ValidBefore was determining text_before_opener by checking the length of the opener. This would produce inconsistent behavior in cases where the opener included a wildcard and was matching some contents.

Example with opener <*>:

Text like text_before_opener
test<A> test
test<String> test<Stri

This fix changes the text_before_opener to also include any matched wildcard characters.