When using the \lstinline macro from listings, like
\lstinline|subl|
some extra whitespace is added to the intended text. It is especially painful at the end of the line: it behaves as if it were a new paragraph, and adds some unwanted indentation. How can I get rid off this? See the example below: the comma immediately following \lstinline goes to the beginning of the next line.

\documentclass{book}
\usepackage{listings}
\lstset{breaklines,postbreak=\kern-1ex}
\textwidth=4cm
\parindent=0cm
\begin{document}
normal text normal text \lstinline{reg1}, \lstinline{reg2}, normal text
\end{document}
\documentclass{...}and ending with\end{document}. – jub0bs Jan 18 '15 at 18:12\lstinlines always fit on one line or can the be expected to linebreak in the middle of the\lstinline? If one line, then\mbox{\lstinline{reg1},}would work. – Steven B. Segletes Jan 19 '15 at 13:00\lstinline. – Steven B. Segletes Jan 19 '15 at 20:14\lstinlineargument always consists of a single word (without spaces), then the\mbox{\lstinline{reg1},}approach I mentioned above should work fine. The issue is if you have a multi-word argument that you desire to break across lines, that is a more difficult problem. – Steven B. Segletes Jan 24 '15 at 18:40breaklines,postbreak=\kern-1exoptions here when you say you don't need to break inline listings across lines? Removing those options fixes the issue – siracusa Oct 18 '18 at 21:45