Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

max_line_length property #12

Closed
dmnd opened this issue Jul 7, 2014 · 9 comments
Closed

max_line_length property #12

dmnd opened this issue Jul 7, 2014 · 9 comments

Comments

@dmnd
Copy link

dmnd commented Jul 7, 2014

The max_line_length property would be nice.

@jpolo
Copy link

jpolo commented Aug 25, 2015

+1

1 similar comment
@cmbaer
Copy link

cmbaer commented Feb 25, 2016

+1

@eriksape
Copy link

eriksape commented May 6, 2016

@florianb
Copy link
Collaborator

florianb commented May 6, 2016

After thinking a little bit about its implementation i wonder how this should be implemented?

The editorconfig claims:

[max_line_length f]orces hard line wrapping after the amount of characters specified

This means at any point in the editing process the editorconfig-plugin should insert a hard-wrap? I currently can't imagine that this might be any helpful, since it takes a additional operation (deleting the inserted newline) to fix a wrong wrap.
I don't know any file format which would tolerate any random hard-wraps.

The second question would be when should the break being introduced, at save of the document or on the fly, while editing the document?

Even though i currently don't see any practical use of a hard wrap over a soft wrap, and i'd expect this rule to be detected by a linter or being done by a "smart" plugin estimating the correct position of a hard wrap i expect to implement this in a few weeks, in order to fulfill the editorconfig-specs.

@Arcanemagus
Copy link

@florianb Isn't this the equivalent of setting:

atom.config.set('editor.preferredLineLength', <max_line_length>)
atom.config.set('editor.softWrapAtPreferredLineLength', true)

At least according to this page a soft wrap at the set value is acceptable, it looks like the other page only lists a hard wrap as acceptable though, so it seems there is some confusion there.

Personally I would say the forced soft wrap is the more reasonable choice, for the difficulties and potentials to introduce confusion that you outline above for forcing an arbitrary line break at the set value.

@florianb
Copy link
Collaborator

florianb commented May 7, 2016

@Arcanemagus - thank you very much, the link is very helpful. These config-settings seem to be the responsible settings (i had them in mind, too) - i have to check how they are implemented and how we may realize a per editor-config. 🍻

@PavelKonon
Copy link

PavelKonon commented Jun 23, 2016

+1

@florianb
Copy link
Collaborator

🎺 The implementation of max_line_length is pending. I would appreciate any help testing it before we're releasing it: #123 (instructions can be found in the PR-description).

@florianb
Copy link
Collaborator

florianb commented Nov 8, 2016

The current implementation of max_line_length is questioned by a raising number of users - i appreciate any contribution to #143.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants