m4xshen / autoclose.nvim

A minimalist Neovim plugin that auto pairs & closes brackets
MIT License
517 stars 14 forks source link

fix: do not escape at the start of line #42

Closed telemachus closed 1 year ago

telemachus commented 1 year ago

While working on the multibyte option, I think I discovered a bug.

Steps to reproduce:

I think that this is unintended behavior. (Compare (, for example, or any other pair where the two characters are not identical.) If not, go ahead and close this PR.

m4xshen commented 1 year ago

I think that this is unintended behavior. (Compare (, for example, or any other pair where the two characters are not identical.)

I see. But the escape of the first quote not only happens at the start of line. If you only fix this behavior at the start of line, it would be different from the behavior at other positions, which might be confusing for users.

telemachus commented 1 year ago

But the escape of the first quote not only happens at the start of line. If you only fix this behavior at the start of line, it would be different from the behavior at other positions, which might be confusing for users.

Ah, okay. I didn't realize that the behavior was the same everywhere. I guess the next questions are (1) Is this behavior intentional? and (2) If it's not intentional, how badly do you want to change the current behavior? That is, maybe this is a corner case that people will not run into often. Feel free to close this if you'd rather leave things as they are.

m4xshen commented 1 year ago

This is not intentional but I want to keep the current behavior.