My code is being formatted in a way that makes it drift off the page when it's too long rather than just jump to a new line. I have tried lots of different things, pasted all kinds of examples from the answers on here for code formatting but none of it seems to stop the lengthy bits from going over. I don't know why it is happening so I am at a loss on how to fix it.
Here is an example of the worst offending (it just goes right out the page for no good reason)
\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage[svgnames]{xcolor}
\usepackage{changepage}
\usepackage{framed}
\usepackage{tikz}
\usepackage{listings}
\usepackage{bbding}
\lstset{backgroundcolor=\color{LightSteelBlue!20},
frame=trbl,
rulecolor=\color{black!30},
xrightmargin=7pt}
\begin{document}
\begin{lstlisting}
public void write(double step, double max, PrintWriter locusOutFile, PrintWriter impOutFile) throws IOException {
\end{lstlisting}
\end{document}
Thanks in advance.
breaklines=true