Long string literal bug in ruby-mode.el?

If I have a string like

$def = <<-EOF

... big chunk of text

EOF

the syntax highlighting in ruby-mode breaks.

Is there a known workaround for this issue?

Thanks
-John

John Lam wrote:

If I have a string like
$def = <<-EOF
... big chunk of text
EOF
the syntax highlighting in ruby-mode breaks.
Is there a known workaround for this issue?

I don't know. I don't think it's the size of the text, though. I think that font-lock-mode gets confused by quotes in some circumstances, like when they are inside regexes inside strings or something like that. I will often add a comment just after the EOF that "closes" the quote it thinks is open. If a single quote doesn't work, then I try a double quote.

$def = <<-EOF
...
EOF
# ' <-- un-confuse Emacs font-lock-mode

Jim

ยทยทยท

--
Jim Menard, jimm@io.com, http://www.io.com/~jimm
"Cheat sheet for the 21st century: Closed, bad. Open, good." -- Wired