Howie
Howie

Reputation: 2778

WebStorm, "surround with" removes newlines

When I use the "Surround with" functionality in WebStorm 9.0.2, it removes all newlines in the selected code. The same happens when I type "}" to close a block of existing code.

How to tell WebStorm to only indent the code, but leave the existing formatting alone. I'll also be satisfied if I could change or downright disable this auto-format behaviour.

Upvotes: 0

Views: 126

Answers (1)

lena
lena

Reputation: 93728

The code is auto-formatted when expanding Live Templates by default (this is controlled by Reformat according to style which is set for each template individually). Also, the code is auto-formatted on adding a brace if Reformat block on typing '}' (Settings | Editor | General | Smart keys) is enabled. You can, of course, disable all mentuioned options... But I'd rather suggest configuring code style settings so that the line breaks are preserved on code reformatting

Upvotes: 2

Related Questions