Problem
I am trying to colour brackets in listings using the \lst@ProcessOther command. My code works perfectly fine when using the breaklines=false option. When using breaklines=true however, \lst@ProcessOther {"29} or \lst@ProcessOther {`)} stops recognising ) characters. How can I use the breaklines feature while still processing ) characters using \lst@ProcessOther?
Example showcasing the problem
\documentclass{letter}
\usepackage{listings}
\usepackage{color}
\makeatletter
\lst@CCPutMacro
\lst@ProcessOther {"28}{% process "(" character
\textcolor{red}{(}
}
\lst@ProcessOther {"29}{% process ")" character
\textcolor{red}{)}
}
\lst@ProcessOther {"5B}{% process "[" character
\textcolor{green}{[}
}
\lst@ProcessOther {"5D}{% process "]" character
\textcolor{green}{]}
}
\lst@ProcessOther {"7B}{% process "{" character
\textcolor{cyan}{\{}
}
\lst@ProcessOther {"7D}{% process "}" character
\textcolor{cyan}{\}}
}
\@empty\z@\@empty
\makeatother
\lstdefinestyle{breakable}{breaklines=true}
\lstdefinestyle{unbreakable}{breaklines=false}
\lstset{frame=single,basicstyle=\ttfamily}
\begin{document}
\begin{lstlisting}[style=breakable,title={\ttfamily breaklines = true}]
([({([()])})])
\end{lstlisting}
\begin{lstlisting}[style=breakable,title={\ttfamily breaklines = true without )}]
[{[{[{[]}]}]}]
\end{lstlisting}
\begin{lstlisting}[style=unbreakable,title={\ttfamily breaklines = false}]
([({([()])})])
\end{lstlisting}
\end{document}

