When listings-fancyverb interface is switched on \FancyVerbFormatLine command set by listings can't handle carriage return (^^M) characters passed to it. Although it's intended to format individual lines, when commandchars are set, commands with arguments containing newlines are passed to \FancyVerbFormatLine as single "lines". This leads to infinite compilation.
As a workaround all ^^Ms are replaced by \emptys before tokens are passed to formatting command.
When
listings
-fancyverb
interface is switched on\FancyVerbFormatLine
command set bylistings
can't handle carriage return (^^M
) characters passed to it. Although it's intended to format individual lines, whencommandchars
are set, commands with arguments containing newlines are passed to\FancyVerbFormatLine
as single "lines". This leads to infinite compilation.As a workaround all
^^M
s are replaced by\empty
s before tokens are passed to formatting command.Fixes newline issue from #20#issuecomment-212977239.