From 68c7b563eb0fb2453075646127da48c35cec3402 Mon Sep 17 00:00:00 2001 From: zufuliu Date: Wed, 1 Jan 2025 09:43:02 +0800 Subject: [PATCH] [Ruby] Fix potential bug for heredoc highlighting. --- scintilla/lexers/LexRuby.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scintilla/lexers/LexRuby.cxx b/scintilla/lexers/LexRuby.cxx index 0c8c59679e..768e6e4543 100644 --- a/scintilla/lexers/LexRuby.cxx +++ b/scintilla/lexers/LexRuby.cxx @@ -375,6 +375,7 @@ bool sureThisIsHeredoc(Sci_Position iPrev, LexAccessor &styler, char *prevWord) switch (prevStyle) { case SCE_RB_WORD: case SCE_RB_WORD_DEMOTED: + //case SCE_RB_IDENTIFIER: break; default: return true; @@ -472,11 +473,9 @@ bool sureThisIsNotHeredoc(Sci_Position lt2StartPos, LexAccessor &styler) { } int prevStyle = styler.StyleAt(firstWordPosn); // If we have '<<' following a keyword, it's not a heredoc - if (prevStyle != SCE_RB_IDENTIFIER + if (!IsIdentifierStyle(prevStyle) && prevStyle != SCE_RB_GLOBAL // $stdout and $stderr - && prevStyle != SCE_RB_BUILTIN_FUNCTION - && prevStyle != SCE_RB_LIKE_MODULE // module::method - && prevStyle != SCE_RB_LIKE_CLASS // class::method + //&& prevStyle != SCE_RB_SYMBOL && prevStyle != SCE_RB_INSTANCE_VAR && prevStyle != SCE_RB_CLASS_VAR) { return definitely_not_a_here_doc;