WrapToColumn icon indicating copy to clipboard operation
WrapToColumn copied to clipboard

Select and wrap multiple paragraphs?

Open jduan opened this issue 5 years ago • 6 comments

First of all, thanks for making such a great plugin to fill the gaps!

A common need of mine is to select multiple paragraphs and wrap them. For example, when you copy a large body of text from somewhere and use them as comment. Is there a way to wrap multiple paragraphs? Thanks!

jduan avatar Apr 21 '20 15:04 jduan

Interesting. Good point. I'll think about this!

abrookins avatar Aug 10 '21 23:08 abrookins

I would like this, too. Specifically, I'd like the ability to run the tool for all paragraphs in the comment/"section" I'm in, and to run the tool for an entire file. (Maybe even also a whole solution.)

cmeeren avatar Nov 12 '21 09:11 cmeeren

I experimented with this today after remembering that I had used the plugin to wrap multiple lines before. Try the Wrap Line to Column action. The default keyboard shortcut on Mac is Command + Control + Shift + W, but check the README for others. You can also select text and access the Intellij Command Palette, then type "Wrap" and select Wrap Line to Column.

This action is maybe not well-named -- it actually wraps all selected lines or the current line if none is selected. Give that a shot.

I just tested this with a Markdown file and a large comment block in Python, and it wrapped multiple lines decently.

abrookins avatar Nov 12 '21 14:11 abrookins

Thanks. That's better, though a feature to wrap all lines in the current comment (no selection needed) would be better. Also, you can't use this for whole files (with code in between the comments).

cmeeren avatar Nov 12 '21 14:11 cmeeren

Ah, yeah, I see what you mean. So the missing features are:

  1. Wrap all lines in current comment without needing selection
  2. Wrap all comments in the current file

Something like that?

abrookins avatar Nov 12 '21 15:11 abrookins

Exactly. Or even better than the second one: wrap all comments in the current selection. Then it's easy to "select all" and do the entire file, but I could also select just part of the file, so it's more flexible.

cmeeren avatar Nov 12 '21 15:11 cmeeren