I want to get colorful prebreak and postbreak tokens with listings package, but the following code doesn't work:
\documentclass{article}
\usepackage{xcolor,listings}
\begin{document}
\begin{lstlisting}[basicstyle=\ttfamily,breaklines,prebreak={\space\color{teal}!},postbreak={\color{blue}!\space}]
This is a long line. This is a long line. This is a long line. This is a long line. This is a long line.
This is another long line. This is another long line. This is another long line. This is another long line.
\end{lstlisting}
\end{document}
How could I resolve this problem?

\textcolorin a\hbox, here? Why is this error occurring? – jub0bs Apr 19 '15 at 09:57\hboxand you get! Improper discretionary list.which is a primitive error in a\discretionarytexbook says: more precisely, the horizontal list formed by each discretionary general text must consist only of characters, ligatures, kerns, boxes, and rules; there should be no glue or penalty items, etc – David Carlisle Apr 19 '15 at 10:05