in cperl-mode
, here docs are colored with a font-lock-string-face
. However if you used any function that inserts a newline on a blank line (e.g. M-: (insert "\n")
) it will cause all code after the newline to be highlighted with font-lock-comment-face
. The only way to fix it is try and "mess with" here doc tags so that cperl re-parses and corrects the font-lock. I have a feeling this may have something to do with this issue since it is also dealing with multi-line syntax highlighting. Is there an expert out there who can help me find a way to fix this?
#!/usr/bin/env perl
my $here_doc = <<'_HERE_';
this is here doc line
<--- call (insert "\n") when cursor is here
_HERE_
cperl-mode
. I recommend youM-x report-emacs-bug
(BTW, it's not just on empty lines: it seems to apply whenever you insert the newline at BOL). In the mean time, you might like to useperl-mode
which doesn't seem to suffer from this bug.