diff options
-rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
-rw-r--r-- | lexers/LexRuby.cxx | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index a5c815628..8109018c1 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -593,6 +593,10 @@ <a href="https://sourceforge.net/p/scintilla/bugs/1933/">Bug #1933</a>. </li> <li> + Ruby lexer recognizes squiggly heredocs. + <a href="https://sourceforge.net/p/scintilla/feature-requests/1326/">Feature #1326</a>. + </li> + <li> Avoid unnecessary IME caret movement on Win32. <a href="https://sourceforge.net/p/scintilla/feature-requests/1304/">Feature #1304</a>. </li> 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 { |