You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Source lines which are entirely a comment should be limited to 80 characters in length (including comment sigils, but excluding indentation) or the maximum width of the line (including comment sigils and indentation), whichever is smaller ...
Current soft_wrap config options
At the time of this comment, here are the Zed config options for soft_wrap:
Description: Whether or not to automatically wrap lines of text to fit editor / preferred width.
Setting: soft_wrap
Default: prefer_line
Options
none to stop the soft-wrapping
prefer_line to avoid wrapping generally, unless the line is too long
editor_width to wrap lines that overflow the editor width
preferred_line_length to wrap lines that overflow preferred_line_length config value
Observations
Assuming there was interest, what would be some good ways to extend soft_wrap to support Rust's style guide? I don't have a particular recommendation in mind yet. But I can make two observations:
It seems to me that soft_wrap would need to be aware of language syntax -- in particular, is a line a comment line?
soft_wrap would also need to have a setting to tell it to ignore indentation.
This is starting to feel a little complicated...
I wonder ... how do other other editors / code-formatters handle this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Background
Some language style guides, including Rust, recommend wrapping at
N
characters excluding indentation.For example, from https://doc.rust-lang.org/beta/style-guide/index.html (with bold text added by me):
Current
soft_wrap
config optionsAt the time of this comment, here are the Zed config options for
soft_wrap
:Observations
Assuming there was interest, what would be some good ways to extend
soft_wrap
to support Rust's style guide? I don't have a particular recommendation in mind yet. But I can make two observations:It seems to me that
soft_wrap
would need to be aware of language syntax -- in particular, is a line a comment line?soft_wrap
would also need to have a setting to tell it to ignore indentation.This is starting to feel a little complicated...
I wonder ... how do other other editors / code-formatters handle this?
Beta Was this translation helpful? Give feedback.
All reactions