You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When inside a cperl HERE doc, using any function that inserts a newline at the start of a line will causes the rest of the file to highlighted with font-lock-comment-face. The only way to fix this is to make changes to the correctly highlighted part of the HERE doc which causes it to re-parse. My guess is that cperl is getting mixed up with POD highlighting and trying to apply cperl-pod-face since POD's and HERE documents are very closely related in cperl-mode code.
To reproduce:
have a cperl-mode file that looks like such
#!/usr/bin/env perl
my $here_doc = <<'_HERE_';
this is here doc line
| <-- call `Eval: (insert "\n")` when cursor is here or at the start of any line
_HERE_
You will see that the rest of the file is highlighted with the comment face. Calling any function that finds the HERE doc region will be incorrect (e.g. cperl-narrow-to-here-doc). I have already confirmed that this bug exists in stock Emacs 25.1 as well.
The text was updated successfully, but these errors were encountered:
The bug has now drawn attention but it is unlikely that it can be fixed in Emacs.
The root cause is the use of the insert function here: Use insert-and-inherit and everything works as expected.
Background: cperl-mode uses text properties to decide about the HEREiness of buffer contents. If you enter text using your keyboard, then text properties will be propagated from its surroundings. However, insert just inserts the raw text without any properties which confuses cperl-mode. insert-and-inherit, on the other hand, will apply the text properties from the surroundings to the text it inserts.
If you can't directly modify the call to insert: The command cperl-find-pods-heres, also available from the menu under
Perl -> Refresh "hard" constructions, re-calculates the text properties and recovers from the situation.
When inside a cperl HERE doc, using any function that inserts a newline at the start of a line will causes the rest of the file to highlighted with
font-lock-comment-face
. The only way to fix this is to make changes to the correctly highlighted part of the HERE doc which causes it to re-parse. My guess is that cperl is getting mixed up with POD highlighting and trying to applycperl-pod-face
since POD's and HERE documents are very closely related incperl-mode
code.To reproduce:
have a
cperl-mode
file that looks like suchYou will see that the rest of the file is highlighted with the comment face. Calling any function that finds the HERE doc region will be incorrect (e.g.
cperl-narrow-to-here-doc
). I have already confirmed that this bug exists in stock Emacs 25.1 as well.The text was updated successfully, but these errors were encountered: