From Hugues Larrive:
Portion of non-latex code in lstlisting environment can break syntax
highlighting.
As exemple the '$' in:
\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}
I think the lstlisting environment should be treated as the verbatim
environment and I did the following modification to do so :
--- geany-1.33.orig/scintilla/lexers/LexLaTeX.cxx
+++ geany-1.33/scintilla/lexers/LexLaTeX.cxx
@@ -291,6 +291,8 @@ void SCI_METHOD LexerLaTeX::Lex(Sci_Posi
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) {
@@ -440,6 +442,10 @@ void SCI_METHOD LexerLaTeX::Lex(Sci_Posi
styler.ColourTo(i - 1, state);
state = SCE_L_COMMAND;
}
+ else if (latexLastWordIs(match, styler, "{lstlisting}")) {
+ styler.ColourTo(i - 1, state);
+ state = SCE_L_COMMAND;
+ }
}
}
} else if (chNext == chVerbatimDelim) {
Committed as [ad96f0].
Related
Commit: [ad96f0]
Committed as [ad96f0].
Related
Commit: [ad96f0]