Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to force long lines to be intelligently wrapped in RubyMine?

Tags:

rubymine

File --> Settings --> Code Style --> Ruby offers a handful of options for how you'd like to format your code, but I don't see a way to set or enforce a max line width. Is this supported somewhere else, perhaps in a plugin?

I'd be okay with having the wrapping occur at specific times, such as when a code formatter is run.

like image 280
Travis Bear Avatar asked Dec 04 '13 17:12

Travis Bear


1 Answers

You can have the editor 'soft wrap' you lines. In Preferences/Editor/General, select 'Use soft wraps in editor'. It wraps the text as a function of the width of the window in which it appears. If you expand the width, the text unwraps to fill the space. The wrapping is only intelligent in that it breaks at spaces and commas and the like. The wrapped line starts in column 1. It would be nice if would indent to the same level as the start of the line. The only way to have it do so that I know of is too manually add carriage returns where you want them to break.

I tried the 'Wrap to Column' option mentioned above. It had no effect on existing code.

I'm sure the OP has already figured this out. I'm only answering because an Internet search brought me here when I was looking for an answer.

like image 79
curt Avatar answered Nov 29 '22 08:11

curt