cohama / lexima.vim

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

The "at" rule does not support \V in command-line mode #139

Closed siaa4fu closed 1 year ago

siaa4fu commented 1 year ago

When the rule is enabled on command-line mode, the regular expression set in "at (lexima-rules-at)" does not support \V

e.g.

" NG: do not work
call lexima#add_rule(#{ char: '.', at: '\V. \%#', input: '<BS>', mode: 'c' })

" OK: but verbose expression
call lexima#add_rule(#{ char: '.', at: '\V. \m\%#', input: '<BS>', mode: 'c' })

" OK: ... I want to use \V
call lexima#add_rule(#{ char: '.', at: '\. \%#', input: '<BS>', mode: 'c' })

Thanks for the nice plugin!

cohama commented 1 year ago

Thank you for reporting. I have just fixed.

siaa4fu commented 1 year ago

Thank you for your fixing.

I tried adding rules in the latest version, but there seems to be a problem with the cursor position.

call lexima#add_rule(#{ char: '(', at: '\V(\%#)', input: '', delete: 1, mode: 'c' })

If an above rule is defined and

()(|
   ^ '(' is inputted at this cursor position,

()|
  ^ the rule is applied incorrectly.

One more thing I found that the 'except' is not working in command-line mode.

Sorry for asking too much.

cohama commented 1 year ago

Thank you.

'except' is not working in command-line mode.

This seems to be other problem. I open a new issue.

cohama commented 1 year ago

I will check cursor position problem

cohama commented 1 year ago

I could reproduce and fixed the cursor pattern problem.