Questions tagged [long-lines]
26 questions
1352
votes
10 answers
How can I do a line break (line continuation) in Python?
Given:
e = 'a' + 'b' + 'c' + 'd'
How do I write the above in two lines?
e = 'a' + 'b' +
'c' + 'd'

Ray
- 187,153
- 97
- 222
- 204
40
votes
1 answer
How to prevent YAML to dump long line without new line
While dumping/serializing data having long lines in input, pyyaml adds extra indentation with new line - which is annoying, how can we avoid this conversion in two lines / multiple lines ?
e.g.
In [1]: x = "-c…

shahjapan
- 13,637
- 22
- 74
- 104
30
votes
2 answers
How can I do a line break (line continuation) in Kotlin
I have a long line of code that I want to break up among multiple lines. What do I use and what is the syntax?
For example, adding a bunch of strings:
val text = "This " + "is " + "a " + "long " + "long " + "line"

bryant1410
- 5,540
- 4
- 39
- 40
5
votes
2 answers
How do I remove newline symbols inside emacs vertical border
I love adaptive-wrap-prefix-mode, which makes a soft-wrap whenever you overcome your window width, nicely formatting text in next line with a non-real ("soft") indentation.
But there is one problem with it. Whenever this happens -- emacs draws a…

Konstantine Rybnikov
- 2,457
- 1
- 22
- 29
5
votes
2 answers
how to unset the foreground color of whitespace-mode for Emacs
In programming files, I use whitespace-mode to highlight the tab and long lines. The default highlighting is too garnish for me.I just want to highlight them with a gray background and keep whatever normal color it should be for the font. How could…

RNA
- 146,987
- 15
- 52
- 70
4
votes
5 answers
Long lines in LaTeX
I have some code I write inside the verbatim environment. Sometimes, the lines are too long and the generated pdf looks ugly - the text row passes over the right margin. What can I do to automatically break these long lines? Is there anything better…

lmsasu
- 7,459
- 18
- 79
- 113
4
votes
4 answers
Highlight lines that are too long
In vim, I can create a rule that highlights lines that are over 80 characters long. Can I do this in IntelliJ? Here's an example in vim:

Rose Perrone
- 61,572
- 58
- 208
- 243
3
votes
3 answers
How to highlight code parts that are longer than 80 chars?
In Emacs, I'd like to highlight the parts of long lines that exceed 80 characters.
The package highlight-80+ is great for that. But how can I automatically enable it when a C++ source file is loaded?
I tried to add highlight-80+ to the C++ mode,…

Frank
- 64,140
- 93
- 237
- 324
3
votes
0 answers
When is implicit line continuation not possible?
Style guides prefer line continuation by parenthesis over continuation with backslashes. From PEP 8:
The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces. Long lines can be…

gerrit
- 24,025
- 17
- 97
- 170
3
votes
2 answers
Haskell lazy Bytestring words not lazy?
I have the following Haskell program for computing a maximum sum substring of a string of integers:
{-# LANGUAGE BangPatterns #-} {-# OPTIONS_GHC -O2 #-}
import Data.Functor
import Data.Maybe
import Data.ByteString.Lazy.Char8…

user1531083
- 750
- 6
- 15
2
votes
4 answers
How do I best handle pylint long-line checks with f-strings?
Let me preface this with the fact that I love both pylint and f-strings. Unfortunately, company policy mandates a maximum line length and using long f-strings is disagreeing with that policy. For example:
xyzzy = f'Let us pretend this line (from…

paxdiablo
- 854,327
- 234
- 1,573
- 1,953
1
vote
0 answers
How to make a long line from a doctest PEP8-compliant?
I have written a function with a doctest. The doctest contains output that is longer than 79 characters, so a PEP8-checker complains, as it should, that
simulation.py:267:80: E501 line too long (344 > 79 characters)
def walk_depth_order(tree,…

Anaphory
- 6,045
- 4
- 37
- 68
1
vote
1 answer
Text editor separator line numbers overlap & long line marker
I am working on a project to create a Text Editor (notepad, basically), in Swing and i have encountered a problem with the line numbers.
I must say i am fairly new to java, but i am doing my best to change that!
You have below the class that…

Catalin Podariu
- 148
- 2
- 8
1
vote
4 answers
Regular expression? How to break lines in Notepad++
I'm translating an ugly formatted lang file of a plugin. It's really uncomfortable as it has no line breaks at all.
How do I enter \n after } and most of all after
"text":"text",
Example of what the code looks like:
{"dir":"ltr","editor":"Rich Text…

Ventricle
- 65
- 5
1
vote
2 answers
How do you break long string lines in Scheme?
For example, I want to break the long string in the below panic statement:
(panic "Truth-assignment length is longer than the number of propositions!")
I have tried
(panic "Truth-assignment length is longer than the number \
of…

Suan
- 34,563
- 13
- 47
- 61