Assuming the following:
\begin{lstlisting}[float]
...
--- NO PAGE BREAK HERE ---
...
\end{lstlisting}
Is it possible to ensure that the whole listing is in the same page ?
Sure. Do nothing. With option float the listing will always be on
one page.
--
Ulrike Fischer
You are correct.
My code didn't looked exactly like the above. The float parameter was
included
in a \lstset command and not in \begin{lstlisting}.
\begin{lstlisting}[float] works as expected.
Thanks!