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 | 0d159a59cb25ad96f808d05cdb883cae4db069f2 (patch) | |
| tree | 2a9a5a83809b92f63333f21175458707e5e31fc5 | |
| parent | e80d98504cd5b9a807fa2b0fe798cacdf7c710b0 (diff) | |
| download | scintilla-mirror-0d159a59cb25ad96f808d05cdb883cae4db069f2.tar.gz | |
Backport: Feature [feature-requests:#1326] Recognize squiggly heredocs.
Backport of changeset 7770:258438d0bd8a.
| -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 8d3addbe8..aef36de77 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -582,6 +582,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 { |
