Replies: 1 comment 1 reply
-
Short answer: No :) Long Answer: It's complicated. The easiest and naive way would be just to try to look at the You can then apply the different formatting functions outlined in our formatting guide to create newlines. The underlying algorithm usually takes good care of trying to accommodate comments in code, but it's not too sophisticated, so don't expect too much. Of course you also need to take care of the "normal" formatting as well, which might actually be in conflict with the line wrapping requirement. I believe it's somewhat doable actually (my initial comment recommended something else, you can take a look at the history of this answer), but still fairly tricky. It will probably require some trial and error, going up and down AST/CST nodes without creating conflicting formattings (i.e. two different formattings applied to the same part of the text). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a "right" way to detect lines that extends beyond a certain column, and wrap them?
Beta Was this translation helpful? Give feedback.
All reactions