diff options
author | Zufu Liu <unknown> | 2019-11-21 15:22:19 +1100 |
---|---|---|
committer | Zufu Liu <unknown> | 2019-11-21 15:22:19 +1100 |
commit | c4a85cf68142ad8605d617beb0488428b6814153 (patch) | |
tree | c1ead4b2b1be96105e3171ad99e2ef554037b37c /lexers/LexRuby.cxx | |
parent | 062939be48211562a60cccfd760545c72ba41193 (diff) | |
download | scintilla-mirror-c4a85cf68142ad8605d617beb0488428b6814153.tar.gz |
Feature [feature-requests:#1326] Recognize squiggly heredocs.
Diffstat (limited to 'lexers/LexRuby.cxx')
-rw-r--r-- | lexers/LexRuby.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lexers/LexRuby.cxx b/lexers/LexRuby.cxx index 2affffe65..6f7c34404 100644 --- a/lexers/LexRuby.cxx +++ b/lexers/LexRuby.cxx @@ -562,7 +562,7 @@ static bool sureThisIsNotHeredoc(Sci_Position lt2StartPos, bool allow_indent; Sci_Position target_start, target_end; // From this point on no more styling, since we're looking ahead - if (styler[j] == '-') { + if (styler[j] == '-' || styler[j] == '~') { allow_indent = true; j++; } else { @@ -888,7 +888,7 @@ static void ColouriseRbDoc(Sci_PositionU startPos, Sci_Position length, int init chNext = chNext2; styler.ColourTo(i, SCE_RB_OPERATOR); - if (!(strchr("\"\'`_-", chNext2) || isSafeAlpha(chNext2))) { + if (!(strchr("\"\'`_-~", chNext2) || isSafeAlpha(chNext2))) { // It's definitely not a here-doc, // based on Ruby's lexer/parser in the // heredoc_identifier routine. @@ -1234,7 +1234,7 @@ static void ColouriseRbDoc(Sci_PositionU startPos, Sci_Position length, int init if (HereDoc.State == 0) { // '<<' encountered HereDoc.State = 1; HereDoc.DelimiterLength = 0; - if (ch == '-') { + if (ch == '-' || ch == '~') { HereDoc.CanBeIndented = true; advance_char(i, ch, chNext, chNext2); // pass by ref } else { |