aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormitchell <unknown>2020-06-17 21:31:53 -0400
committermitchell <unknown>2020-06-17 21:31:53 -0400
commit7118d8f892a0b62a8ac09ad36b06e080aaa53cea (patch)
tree086f163165a320784e1111bd881bc86bb4c6c8e9
parenteb79217e0a5b400bcb4e049c67defb5dda593af9 (diff)
downloadscintilla-mirror-7118d8f892a0b62a8ac09ad36b06e080aaa53cea.tar.gz
Backport: Feature [feature-requests:1358]. Support lstlisting environment that is similar to verbatim.
Backport of changeset 8293:ad96f0ae7df5.
-rw-r--r--doc/ScintillaHistory.html5
-rw-r--r--lexers/LexLaTeX.cxx5
2 files changed, 10 insertions, 0 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 898eb6d4c..f572606af 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -547,6 +547,7 @@
<td>McLoo</td>
</tr><tr>
<td>Chris Graham</td>
+ <td>Hugues Larrive</td>
</tr>
</table>
<p>
@@ -591,6 +592,10 @@
<a href="https://sourceforge.net/p/scintilla/bugs/2019/">Bug #2019</a>.
</li>
<li>
+ The latex lexer supports lstlisting environment that is similar to verbatim.
+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1358/">Feature #1358</a>.
+ </li>
+ <li>
Fixed bug with GTK on recent Linux distributions where underscores were invisible.
<a href="https://sourceforge.net/p/scintilla/bugs/2173/">Bug #2173</a>.
</li>
diff --git a/lexers/LexLaTeX.cxx b/lexers/LexLaTeX.cxx
index 496d04177..4b6cbdc6e 100644
--- a/lexers/LexLaTeX.cxx
+++ b/lexers/LexLaTeX.cxx
@@ -305,6 +305,8 @@ void SCI_METHOD LexerLaTeX::Lex(Sci_PositionU startPos, Sci_Position length, int
latexStateReset(mode, state);
if (latexLastWordIs(i, styler, "{verbatim}")) {
state = SCE_L_VERBATIM;
+ } else if (latexLastWordIs(i, styler, "{lstlisting}")) {
+ state = SCE_L_VERBATIM;
} else if (latexLastWordIs(i, styler, "{comment}")) {
state = SCE_L_COMMENT2;
} else if (latexLastWordIs(i, styler, "{math}") && mode == 0) {
@@ -453,6 +455,9 @@ void SCI_METHOD LexerLaTeX::Lex(Sci_PositionU startPos, Sci_Position length, int
if (latexLastWordIs(match, styler, "{verbatim}")) {
styler.ColourTo(i - 1, state);
state = SCE_L_COMMAND;
+ } else if (latexLastWordIs(match, styler, "{lstlisting}")) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_L_COMMAND;
}
}
}