Closed jasoncodes closed 2 years ago
Wow, how long has this bug been hiding? If I was writing it today I would probably avoid \v
entirely, but this is more than good enough.
I discovered this when updating an older install and bisected it down to 37aa670baddf3dd18d3637c82c197342e542e084. So, only 3 years or so. :)
Good to know you’d probably avoid \v
today. I might have gone for a rewrite if it were the only \v
I spotted in the code but decided for a minimal change instead.
This PR fixes the following error when invoking
:R
from a.sql
file:The problem is the
s:sql_define
pattern sets\v
(very magic mode) which is then embedded into amatchstr
pattern insides:readable_last_method
which does not expect the magic mode to the changed from the default.I saw two options for solving this:
s:sql_define
pattern to reset back to magic mode (\m
), ors:readable_last_method
to reset back to magic mode (\m
) after embeddingself.define_pattern()
The second option seemed to be more robust against other pattern inputs and I did not see
s:sql_define
being used as a part of other patterns elsewhere.