I got a bit of trouble with the listings package. I am trying to highlight a custom language with lstdefinelanguage
but for reasons I can't understand, highlighting for my )
keyword, and only the )
keyword, breaks as soon as I enable breaklines
in lstset
.
I'd expect the keyword )
to get highlighted just like (
, +
and so on even if breaklines
is set to true
.
Here's a minimal example to reproduce the issue:
\documentclass[10pt, leqno]{article}
\usepackage{listings}
\usepackage[usenames,dvipsnames]{color}
\lstdefinelanguage{Test}
{
morekeywords = {), +, (},
alsoletter={), +, (},
}
\lstset{
keywordstyle=\color{red},
breaklines=true % As soon as this is true highlighting for ) breaks
}
\begin{document}
\begin{lstlisting}[language=Test]
)
+
(
A very long line that will get broken A very long line that will get broken A very long line that will get broken A very long line that will get broken
\end{lstlisting}
\end{document}
Is it me doing something wrong or is this a problem with the package?