diff options
Diffstat (limited to 'lexers')
-rw-r--r-- | lexers/LexRuby.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lexers/LexRuby.cxx b/lexers/LexRuby.cxx index be60f8041..e4fd575fe 100644 --- a/lexers/LexRuby.cxx +++ b/lexers/LexRuby.cxx @@ -466,6 +466,7 @@ static bool sureThisIsNotHeredoc(Sci_Position lt2StartPos, prevStyle = styler.StyleAt(firstWordPosn); // If we have '<<' following a keyword, it's not a heredoc if (prevStyle != SCE_RB_IDENTIFIER + && prevStyle != SCE_RB_SYMBOL && prevStyle != SCE_RB_INSTANCE_VAR && prevStyle != SCE_RB_CLASS_VAR) { return definitely_not_a_here_doc; @@ -1088,6 +1089,10 @@ static void ColouriseRbDoc(Sci_PositionU startPos, Sci_Position length, int init // <name>= is a name only when being def'd -- Get it the next time // This means that <name>=<name> is always lexed as // <name>, (op, =), <name> + } else if (ch == ':' + && isSafeWordcharOrHigh(chPrev) + && strchr(" \t\n\r", chNext) != NULL) { + state = SCE_RB_SYMBOL; } else if ((ch == '?' || ch == '!') && isSafeWordcharOrHigh(chPrev) && !isSafeWordcharOrHigh(chNext)) { |