sindresorhus / atom-editorconfig

Helps developers maintain consistent coding styles between different editors
https://atom.io/packages/editorconfig
MIT License
812 stars 80 forks source link

Integrate `max_line_length` property with Atom Autoflow package #184

Closed audreytoskin closed 1 year ago

audreytoskin commented 7 years ago

The Autoflow package provides a reflow command, which rearranges and hard-wraps the current "paragraph" or selection to be a block of text with each line close to but no more than the value of Atom's global editor.preferredLineLength property. (It's mostly useful for plain prose, and (certain) markup languages, but I use it a lot for those cases.) I think it would make sense and be useful for EditorConfig's max_line_length property to adjust this setting so that text reflows to that line length.

There's some talk about changing the semantics of the max_line_length directive to be just a visual hint, since safely hard-wrapping lines would require awareness of the current file's language syntax. Atom already seems to do this, and I think requires that the Atom wrap-guide package be installed and enabled. The wrap guide by default also uses Atom's editor.preferredLineLength setting, so applying max_line_length to both reflow and wrap guide makes sense to me.

I might have suggested this to upstream EditorConfig repo, but I don't know if very many editors have Autoflow-like functionality, built-in or otherwise.

florianb commented 7 years ago

Hi @terrycloth - thank you for getting in touch. I am not 100% sure what you're after.

The interception of the wrap-guide package causes some continuous amount of work and is something i intentional chose to deliver. Besides of that, depending on the wrap-guide package solves a lot of headaches and some issues in the history of this package.

I currently dont's see that Autoflow is in any case worth the same effort. However, we're not sticking to the editor's settings of the line lengths but to the underlying buffer's settings.

A way to achieve Autoflow respecting editorconfig settings could be asking them to change the behavior of Autoflow (unlikely to happen, i guess) or to fork Autoflow and make your fork depend on our settings.

Don't get me wrong, i'd like to improve Atom-Editorconfig but the change needs to bring a benefit to a significant amount of users, making the efforts worth to spend. And for your current demand - intercepting Autoflow - i can't see how the effort-benefit ratio would be good enough.

But i am happy to discuss any further ideas or supporting you with any next steps.

audreytoskin commented 7 years ago

The Atom Packages listing shows that Autoflow has been downloaded 294,508 times, a similar number as have downloaded EditorConfig, which I think makes it among the more popular Atom packages. I guess I don't know what the numbers are for people who use both, but I would assume a nontrivial number.

I can see the argument that maybe Autoflow should implement it, though. I'll ask them.

florianb commented 7 years ago

Autoflow is a core package and even though probably every Atom user has Autoflow installed, you are the first user demanding that feature. That's how I tried to derive the significance - it wasn't meant to be offensive.

We will see how they respond. I would be happy to make Autoflow's support for editorconfig happen.

sindresorhus commented 1 year ago

Closing as Atom is abandoned.