Closed papandreou closed 7 years ago
Hi @papandreou -- thanks for getting in touch. I don't know if i get you right.
You disabled "SoftWraps" in your AtomEditor-Config and therefore expect entirely no Softwraps in your project?
The max_line_length
feature was introduced in v2.0.0. And due to the nonexistent possibility of Atom to make HardWraps, it is implemented as SoftWrap. It might be, that what you're facing is the actually desired behavior.
I would like to ask what would you expect how max_line_length is working?
Thanks for replying :)
What I've disabled is the editorconfig plugin's own "Soft Wrap" setting, which is described as:
Wraps lines that exceed the width of the window. When
Soft Wrap At Preferred Line Length
is set, it will wrap to the number of characters defined by thePreferred Line Length
setting.
I expected that turning off that setting would cause editorconfig 2.0.0+ not to touch the soft wrap setting at all, regardless of whether max_line_length
is set in .editorconfig
.
Here's how I've set up the editorconfig plugin:
I see.. thanks for clarification. These settings from above take control over the .editorconfig Grammar, which means they're applied when working on .editorconfig
-files and they are applied by the editors grammar-scope aware packages (like the whitespace-plugin f.e.).
That said to explicitly disable the max_line_length-property of editorconfig when working in your project, you either need to remove the max_line_length-property or set it to max_line_length = off
.
I'm fine with max_line_length
having some kind of effect, such as showing that vertical line at the configured limit. As long as it doesn't turn on soft wrap (without allowing me to disable that particular behavior globally).
Same problem here. Code wraps at max_line_length
no matter what my Soft Wrap settings say 😕
@manuelbieh -- as described before, if an editorconfig containing a max_line_length
-property is applied, the Wrap-behavior for the affected file is skipped.
I treat that behavior as standard-conform (except that we're not hard-wrapping, as the Editorconfig-standard defines.
This issue has been discussed on https://github.com/editorconfig/editorconfig/issues/89.
In order to change that i see the following options:
atom-editorconfig
behaves different than the standard describes.max_line_length
-definition.I close this issue because this seems to be no bug. Feel free to keep discussing.
I got rid of my problem by removing the max_line_length
in the particular project, as it wasn't being adhered to anyway (otherwise I wouldn't have been annoyed by the soft wrapping :).
However, I still think that this plugin touching the soft wrap settings of a given file is a bit too surprising -- especially when there's apparently no way to turn off the behavior. However, it's your software, and right now I'm not so affected by the issue that I'll consider forking it. You'll probably get more reports about this, and then you might reconsider :)
Same problem here and I agree with @papandreou and @manuelbieh. @florianb: couldn't Soft wrap be applied only if set in the global settings or maybe in an option of the editorconfig package?
Probably i don't get it. Could anybody explain to me:
max_line_length
to do?I would like to be able to specify a "preferred max length" so that the wrap-guide will be able to show the vertical line where I should break the line without enabling the soft/hard wrap at that value. Before the update this was the behaviour I experienced. At the same time, however, I see your point... the new behaviour is what is described in the editorconfig standard you linked.
I took a quick glance at the Emacs plugin, which seems to handle max_line_length
by setting the "fill column", which controls where the fill commands wrap (when explicitly invoked).
The vim editorconfig plugin looks like it just highlights the extraneous characters like I suggest: https://github.com/editorconfig/editorconfig-vim/blob/master/plugin/editorconfig.vim#L565-L589
@apbard - thanks for replying that fast. In fact prior v2 of this package, max_line_length
was not implemented (and therefore did nothing).
You might consider removing (or disabling) the max_line_length
-setting to restore the max_line_length-behavior of < v2.
@papandreou, I appreciate your references to the VIM- and the Emacs-integration and i am glad you came to the same conclusion that it's more convenient to apply soft over hard wraps.
However, being compared to non-conforming implementations misses in my opinion the point. Personally i would probably be fine changing this behavior to a visual hint. But you already mentioned it, applying editorconfig, standardizing the behavior of editors deals at its core with the problem of surprise when multiple environments work on the same resources.
So if i decide to make use of editorconfig, i would research which properties to apply, expecting the described behavior in the standard. The standard stipulates we should (hard) wrap at the given line-length. If we would change the behavior for atom-editorconfig i would have to deal with the (reasonable) complaints about its surprising and non-conformant behavior.
I would like to see this discussion to happen on https://github.com/editorconfig/editorconfig because this is where it belongs to. And if the standard changes we will of course change it, too.
In the meantime i see no applicable changes to the default-behavior which are assumingly not surprising the majority of our user-base. I, however, could live with supporting an alternative (optional) change of behavior, but this would need introducing a persistent config-option and in the history of this plugin this is not usual to quickly introduce any configuration-options.
I would be happy to hear any additional opinions on this - or even get an idea how many users deal with this "problem".
/cc @sindresorhus @slang800 @eddiemonge
P.s.: This is not my software. I am maintaining atom-editorconfig because i want to use it.
I would personally not have implemented max_line_length
at all, as I don't see the point of hard-wrapping ever, but I'm not gonna start that kind of flamewar here. We should follow the EditorConfig spec. If you disagree with the spec, take the discussion to https://github.com/editorconfig/editorconfig/issues
If the Atom Plugin API really does not support to force a hard wrap as I read it somewhere above, the editorconfig package is also not following the specs by just implementing a soft wrap instead - so why implement it at all instead of letting the user still "override" the (new) EditorConfig behavior via SoftWrap setting?
Why not make it optional or dependent on the user's SoftWrap setting?
If a max_line_length
is specified in the user's .editorconfig
and softwrap is enabled in Atom's settings, the package should/could soft wrap at the given max-length (instead of the preferred line length).
If a max_line_length
is specified in .editorconfig
but softwrap is disabled in Atom, the package should just ignore the max-length since it can't add hard wraps (as defined in the specs) anyway.
It should in any case (no matter if soft wrap is enabled or not) show a length marker at max_line_length
.
Since a raising number of users complain about this implementation i am probably going to change the behavior.
Even though i don't understand why people set a max_line_length if they don't want it being applied.
You're welcome to join the discussion for enhancement in #143. ☕️
Since a raising number of users complain about this implementation i am probably going to change the behavior.
Great to hear that :)
Even though i don't understand why people set a max_line_length if they don't want it being applied.
I think the complaints can be summarized as "there are good and a bad ways to apply it, and mapping it to Atom's Soft Wrap is one of the bad ones if it's turned off in the user's settings".
Also, note that an important use case is working on a fork of someone else's project containing an .editorconfig
that you don't want to edit if you can avoid it. If they've put max_line_length
in there, it's nice to get some help adhering to it -- without your editor changing its behavior fundamentally.
I agree, this is a reasonable argument.
Soft wrap no longer works anymore.
@robcrowther - thank you for your contribution. It is unlikely that your observed behavior is connected to this issue due to code-changes. I'd recommend you to open a new issue instead of following up on this one.
I just upgraded to version 2.0.1 of the editorconfig plugin, and now my "Soft Wrap" setting (disabled) is no longer being honored. Every time I open or switch to a file in a project that has a
max_line_length
setting in the editorconfig, the Soft Wrap feature is turned on.Involved .editorconfig-files
Directory structure
(huge and irrelevant for this issue)
Installed packages