Closed HawkinsT closed 1 year ago
It is indeed screwy regex. AutoPairsBackspace
doesn't properly escape close
:
For comparison, this is from AutoPairsInsert, which is fine:
The problem is that I use \V
to "disable" regex constructs, so to use a group, you'd have to use \(\)
. This is where the bad escape comes in. The escape method transforms \)
to \\)
, which is interpreted as the literal \)
rather than as a regex group.
As for the enter problem, same cause, in theory. Missing escape. Weird thing though, it doesn't error out for me (admittedly in Vim). I don't understand why, but I mean, if I can fix it anyway, it doesn't really matter.
I really need to revisit a large part of the pattern matching. I'll make a hotfix for the errors (or try anyway), but if that doesn't fix return, that's a wontfix until #53 is fixed (which I've been putting off because of Other Stuff:tm:, but no time like the present I suppose)
Many thanks for your quick response (and continued work on auto-pairs)! I'll await your hotfix and report back; let me know if you'd like me to test anything else related to this.
Hotfix pushed; confirmation it also works in neovim would be great!
I can confirm that BS and CR now work as expected in Neovim also. Thanks again!
OS Arch Linux What vim? (+ version) Neovim 0.8 and 0.9.0-dev
Autopairs config (if applicable):
Describe the bug I'm using the above multibyte pairs for latex.
\[
and\left(
work fine and are just here for comparison.\(
also works fine and creates the associated\)
pair, however if I then hit backspace I get the warning:then
However the deletion works (it just deletes one byte so I end up with
\|\)
where|
is the cursor position). Deleting the other three bytes now also results in these same two errors being repeated three more times.As another scenario, after creating the matched pairs
\(|\)
if I hit<CR>
I get the error:and then the CR happens so I end up with:
instead of
as happens with, e.g. ( and ).
Since this doesn't happen with the matched pairs
\[|\]
or\left(|\right)
my assumption is it's some screwy regex related to #53. I've tested this on all three branches and an otherwise blank config (except for bootstrapping packer and loading auto-pairs with the above settings) and all have this issue.