diff options
author | Hugues Larrive <unknown> | 2020-06-09 21:10:02 +1000 |
---|---|---|
committer | Hugues Larrive <unknown> | 2020-06-09 21:10:02 +1000 |
commit | 7e265143af4ccd9d3614c8aca6e3ee1cbd809c7d (patch) | |
tree | a6e70dc762ab828a943ffa397deb068ca09fc35d | |
parent | 4b01695fc57d24e455a4b2f7a17d4db19c449fec (diff) | |
download | scintilla-mirror-7e265143af4ccd9d3614c8aca6e3ee1cbd809c7d.tar.gz |
Feature [feature-requests:1358]. Support lstlisting environment that is similar
to verbatim.
-rw-r--r-- | doc/ScintillaHistory.html | 14 | ||||
-rw-r--r-- | lexers/LexLaTeX.cxx | 5 | ||||
-rw-r--r-- | lexilla/test/examples/latex/Feature1358.tex | 10 | ||||
-rw-r--r-- | lexilla/test/examples/latex/Feature1358.tex.styled | 10 |
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} |