# Inconsistent style of "other keywords" when breaklines=true [duplicate]

Some keywords defined with the otherkeywords key are not formatted as expected when breaklines is set to true. Here is my MWE:

\documentclass[12pt, a4paper]{article}
\usepackage{listings}
\lstset{
basicstyle=\itshape\ttfamily,
keywordstyle=\upshape,
}
\lstdefinestyle{syntax}{
language=[ANSI]C,
otherkeywords={(,)},
breaklines=true,
}

\begin{document}
\begin{lstlisting}[style=syntax]
const ( int | float ) text
\end{lstlisting}
\end{document}


The result looks something like this (but nicely monospaced...):

const ( int | float ) text

If I set breaklines=false, it looks as expected:

const ( int | float ) text

Am I missing something obvious? As for versions, "This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9)" on Windows (at work, they force me...).

• Literate replacements and "other keywords" that involve the closing-parenthesis character ) are known to be affected by breaklines. See tex.stackexchange.com/questions/73795/… and its accepted answer for a workaround. Jun 23 '14 at 16:09
• Jun 23 '14 at 16:11
• Jun 23 '14 at 16:15

\documentclass{article}
\usepackage{listings}
\usepackage{etoolbox}

\lstset{
basicstyle=\itshape\ttfamily,
keywordstyle=\upshape,
}

\lstdefinestyle{syntax}{
language=[ANSI]C,
breaklines=true,
otherkeywords={(,)},
}

\makeatletter
\patchcmd{\lsthk@SelectCharTable}{)}{}{}{}
\makeatother

\begin{document}
\begin{lstlisting}[style=syntax]
const ( int | float ) text
\end{lstlisting}
\end{document}
`