-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for max_line_length
#57
Add support for max_line_length
#57
Conversation
* Support for this feature requires the user to have installed the autowrap plugin https://github.com/randy3k/AutoWrap
max_line_length
@@ -103,4 +104,14 @@ def apply_config(self, view, config): | |||
elif insert_final_newline == 'false': | |||
settings.set('ensure_newline_at_eof_on_save', False) | |||
|
|||
if isinstance(max_line_length, int) and max_line_length: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think max_line_length
is always a string, so you'll need to coerce it into an int
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be an int if typed as max_line_length = 123
instead of max_line_length = "123"
?
But I agree it can be made more flexible by parsing a string, if that's the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, just tested it again. Indeed it's true. I think I tested it first by having a max length in my user preferences.
Thanks for the heads up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally yes, but .editorconfig
is based on .ini
, which is untyped and unspec'd, so everything are just strings.
Coerce max_line_length to int
I thought it was still not working at first, then I realized it only works on new text. Any way to get it to auto wrap existing text? (That's how the other rules work). |
And why does it require a plugin for this? Sublime already has |
Because of
That, I didn't know... :) Will most likely require rewriting everything. |
Closing this for lack of activity. Happy to reopen whenever. |
It's fine, I don't have to look at it now. |
plugin https://github.com/randy3k/AutoWrap