Closed CeleritasCelery closed 6 years ago
That's the expected behaviour, as cperl-mode can't find the closing |
for a m|...|
match.
I realize now that using |
to indicate the cursor position was a mistake. The file looks like this
#!/usr/bin/perl
my $foo;
there is no |
in the file. typing m
(as in starting to type the keyword my
) before my $foo
leads to the error. However typing the letter m
after my $foo
does not lead to the error. In either case, there are no unbalanced parenthesis.
There are. Try it with a variable name that contains m
:
#!/usr/bin/perl
m
my $foo_m;
As running perl -MO=Deparse
on the source tells us, it's equivalent to
/y $foo_/;
because perlop:
When using a character valid in an identifier, whitespace is required after the "m".
Wow. You are right. Since this issue doesn't throw an error (just prints), its manageable. It would be nice however, if the major mode either suppressed this error or found a better way to handle it, as it's quite confusing if you do not know what is going on.
Using the test file below with the cursor located at
|
try to type the m character.You will see the error
End of ‘mp ... p’ string/RE not found: (scan-error Unbalanced parentheses n n)