Rewrap icon indicating copy to clipboard operation
Rewrap copied to clipboard

Optionally rewrap entire selection, not just comments

Open SteveKing opened this issue 4 years ago • 1 comments

The ability to select a large block of code and hit Alt-Q to rewrap comments but not the code is kind of neat, but it interferes with some use cases. INI files (certain dialects, at least) support multiline values by prefixing additional lines with whitespace.

[SECTiON]
tag = This
    is a
    multiline
    value.

Rewrap refuses to rewrap this. Rewrapping comments in INI files works fine, so I presume the refusal here is due to the block being "code", not comment. How about adding a flag to wrap selections unconditionally? If I select something and hit Alt-Q don't bother checking if it's a code or comment, just rewrap it. This doesn't need to be language-specific and pretty-print the code, a normal paragraph wrap would be perfectly fine.

SteveKing avatar Sep 01 '21 19:09 SteveKing

This is possibly a dup of issue #136 "Rewrap for all code", but I think that one is looking for wrapping that remains syntactically correct so it would have to be language-aware. This request is just to follow the existing paragraph wrapping rules.

SteveKing avatar Sep 01 '21 19:09 SteveKing