Rewrap icon indicating copy to clipboard operation
Rewrap copied to clipboard

Feature request: a mode that doesn't remove linebreaks

Open ubalklen opened this issue 3 years ago • 0 comments

While Rewrap can preserve linebreaks by adding two spaces before them, there are instances where you simply don't want linebreaks to be removed at all.

As an example of a use case, I use Rewrap to nicely format Python docstrings. I need to keep some linebreaks in place, but I can't use the double space technique since my code formatter eliminates them. And I think the formatter is correct -- those spaces should not be there. And even if I could keep the formatter away from my docstrings, I would have to remember to add two spaces every time I want to properly wrap a docstring.

So my proposal is the addition of a flag to indicate that linebreaks should not be removed during wrapping. This also fits a more strict view of line wrapping as line breaking.

ubalklen avatar Apr 03 '22 14:04 ubalklen