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

no closer is inserted for class*| as the opener #34

Closed rektrex closed 5 years ago

rektrex commented 5 years ago

Title is not very accurate because I wanted to avoid using a "clickbaity" title. The problem is that the closer is not inserted for an opener which ends with a pattern similar to ass*|.

To reproduce, compare the behaviour of:

let b:pear_tree_pairs = extend(deepcopy(g:pear_tree_pairs), {
            \ 'ass*|': {'closer': ' end'}
            \ }, 'keep')

with

let b:pear_tree_pairs = extend(deepcopy(g:pear_tree_pairs), {
            \ 'bss*|': {'closer': ' end'}
            \ }, 'keep')
tmsvg commented 5 years ago

I need more info, because the two examples you give behave identically for me. Could you please show me:

  1. The rest of your g:pear_tree_pairs if it's not the default

  2. The behavior of ass*| vs bss*|

  3. An example of what the wildcard part could be in this case

Also (not totally relevant, but) what programming language is this for?

rektrex commented 5 years ago
  1. No other modifications to g:pear_tree_pairs was done.

  2. For ass*|, the closer(end) is not added but it is added for bss*|.

  3. I was using any letter as the wildcard. I was trying to add a closer for class in ruby but it didn't work so, I kept playing with the opener and found that clbss was working.

The behaviour is not consistent, when I created the issue, bss*| was working but ass*| was not. After sometime, both were working. Right now neither of them are working.

Edit: Tried it again and everything works as expected. Closing the issue because it's not reproducible.