cohama / lexima.vim

Auto close parentheses and repeat by dot dot dot...
995 stars 46 forks source link

Delete inefective for numbers greater than 1 #111

Closed ngmoviedo closed 2 years ago

ngmoviedo commented 3 years ago

I'm trying to add backspace rules for custom parens, but I've noticed that the delete option doesn't work when the number is greater than 1.

call lexima#add_rule({'char': '<BS>', 'at': '\\left(\%#\\right)', 'input': '<BS><BS><BS><BS><BS><BS>', 'delete': 7, 'filetype': 'tex'})

Expected behavior:

Before            Input     After
\left(|\right)     <BS>    |

Actual behavior

Before            Input     After
\left(|\right)     <BS>    |\right)

Setting delete to 1, works by deleting the first character to the right. As a workaround, I have added 7 <Del> keys to the input, which is a bit verbose and not dot-repeatable, but does the job.

cohama commented 2 years ago

Confirmed. I try to fix.