From 7118d8f892a0b62a8ac09ad36b06e080aaa53cea Mon Sep 17 00:00:00 2001 From: mitchell Date: Wed, 17 Jun 2020 21:31:53 -0400 Subject: Backport: Feature [feature-requests:1358]. Support lstlisting environment that is similar to verbatim. Backport of changeset 8293:ad96f0ae7df5. --- lexers/LexLaTeX.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lexers') 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; } } } -- cgit v1.2.3