How do I define a style to show line continuations?

I’m writing a document that includes examples of computer code formatted in a custom style. Sometimes these code lines are too long to fit the document width and split across two lines. Is there a way to format the style so that it automatically adds a continuation symbol to the split lines to indicate that the line continues? For example:

echo "This is really just one long line of text."

might format as

echo "This is really just one  …
long line of text."

I have the same need, but to the best of my knowledge you can’t automatically insert characters or bullet when a line wraps.

My workaround is to use a custom typographical convention where I warn the reader that my computer sample “lines” have a colour background. If the background is continuous, then the whole paragraph is a single computer command. Small white spaces delimit independent lines. It is better explained with an example:

image description

Here, I customised Preformatted text to have a gray background and I set spacing above and below to 0.05 cm so that there is always a small gutter between paragraphs. This is quite large but I wanted it to be “striking” in this example.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

That is a good idea and arguably neater than adding continuation characters.

As a variation, you can also add an indent on 2nd+ lines (Before text set to 1cm, First line to -1cm) so that you easily spot visually where new lines begin.