Rewrap
Rewrap copied to clipboard
Wrapping fails when preceding indent is large enough
Hiya, I've just hit this case and I'm not sure if it's intentional.
The long and short of it is that I have indent width = 3 spaces (wrap column = 79) and Rewrap seems to ignore long lines that are indented 7 spaces or more.
Simple visual demonstration in a C++ comment, which is where I hit the issue. These two comments are identical except that the second one is indented by 7 spaces and the first one by 6. Rewrap will wrap the first one on alt-q, but does nothing to the second.
/*
This is a very very long test comment. It is very very extremely long, so long it goes over multiple lines.
*/
/*
This is a very very long test comment. It is very very extremely long, so long it goes over multiple lines.
*/
It's quite troublesome as I sometimes write explanatory comments with "section headers" and indent the body, something like this:
/*
Doing a thing:
Initialising the thing:
Some long explanatory paragraph where I explain how to initialise the thing. This paragraph will not wrap because it's indented too much.
Proceeding:
The spec (page 123) says this:
Blah blah blah something I copied in from a specification for context and will certainly not fit on a single line
So we first have to blah blah
*/
And with paragraphs indented like that I'm having to wrap them manually. Is this behaviour intentional? I went looking for a relevant setting but couldn't find any. It's quite troublesome, just thought I'd bring it up as an issue. Thanks!
I'm seeing the same with Python docstrings. I'm using v1.14.0. I've found that the issue only exists if there's a blank line above the indented section where it stops working:
