aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaHistory.html14
-rw-r--r--lexers/LexLaTeX.cxx5
-rw-r--r--lexilla/test/examples/latex/Feature1358.tex10
-rw-r--r--lexilla/test/examples/latex/Feature1358.tex.styled10
4 files changed, 39 insertions, 0 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 65ee8e932..ee3714a8c 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -554,6 +554,7 @@
</tr><tr>
<td>Shmuel Zeigerman</td>
<td>Chris Graham</td>
+ <td>Hugues Larrive</td>
</tr>
</table>
<p>
@@ -566,6 +567,19 @@
</li>
</ul>
<h3>
+ <a href="https://www.scintilla.org/scite444.zip">Release 4.4.4</a>
+ </h3>
+ <ul>
+ <li>
+ Released 3 June 2020.
+ </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>
+ </ul>
+ </ul>
+ <h3>
<a href="https://www.scintilla.org/scite443.zip">Release 4.4.3</a>
</h3>
<ul>
diff --git a/lexers/LexLaTeX.cxx b/lexers/LexLaTeX.cxx
index 52f10aec7..6376bd7d6 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;
}
}
}
diff --git a/lexilla/test/examples/latex/Feature1358.tex b/lexilla/test/examples/latex/Feature1358.tex
new file mode 100644
index 000000000..88863303f
--- /dev/null
+++ b/lexilla/test/examples/latex/Feature1358.tex
@@ -0,0 +1,10 @@
+\begin{lstlisting}[language=make]
+# If no BOARD is found in the environment, use this default:
+BOARD ?= bluepill
+
+# To use chinese st-link v2 and ch340 dongle with bluepill
+ifeq ($(BOARD),bluepill)
+STLINK_VERSION=2
+PORT_LINUX=/dev/ttyUSB0
+endif
+\end{lstlisting}
diff --git a/lexilla/test/examples/latex/Feature1358.tex.styled b/lexilla/test/examples/latex/Feature1358.tex.styled
new file mode 100644
index 000000000..e753ea14d
--- /dev/null
+++ b/lexilla/test/examples/latex/Feature1358.tex.styled
@@ -0,0 +1,10 @@
+{1}\begin{2}{lstlisting}{8}[language=make]
+# If no BOARD is found in the environment, use this default:
+BOARD ?= bluepill
+
+# To use chinese st-link v2 and ch340 dongle with bluepill
+ifeq ($(BOARD),bluepill)
+STLINK_VERSION=2
+PORT_LINUX=/dev/ttyUSB0
+endif
+{1}\end{5}{lstlisting}{0}