-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
"Keep line breaks" option #1565
Comments
Hi @Vampire - there is an option in the AsciiDoc plugin's settings in Code Style where you can disable the "One sentence per line" rule. This might solve the examples given above. See the screenshot below where to change this. Still there are several reasons why to use the one-sentence-per line, see https://asciidoctor.org/docs/asciidoc-recommended-practices/#one-sentence-per-line Please let me know if this resolves your situation. |
Thanks, but I am fully aware of that option and I even mentioned the option in my description twice. There are two aspects to the "One sentence per line". Also the reasoning for the "One sentence per line" best practice has similar two aspects. The only reasonings on that best practice paragraph that imho describe advantages of not having a sentence split onto multiple lines are:
I personally don't really care about that.
Well, some sentences are longer some shorter, where is the problem? The drawback of having very long sentences on one line though are, that without softwrapping they easily start to be very hard to read. Not every editor supports soft-wrapping. Not every web-application supports soft-wrapping. Not every E-Mail client that might display diffs supports soft-wrappgin. ... Also the sentence
is exactly right, while imho text and code are two majorly different things and should not really be compared. And that same I would prefer to do with text. Of course I can disable that option and do it completely manually, and that is what I do right now. But I thought it would be beneficial if you could have it enabled, with the option to keep line breaks just like in other formatters, so that the option can split for me lines with multiple sentences but does not touch my sentence on multiple lines. If you really don't like it, feel free to close this as wont-fix, no problem for me even if a bit sad. :-) |
Thank you for the explanation, I now see understand the behavior you want to see. I won't discuss the "One sentence per line" here, though, as it is out of scope for this issue. I mark it as "help wanted" and wait if someone picks it up. If there are no votes and no-one picking it up, I might eventually close it. |
Hi @ahus1, My suggestion would be like the one from @Vampire, to introduce a new parameter "Keep line breaks", which depends on the "One sentence per line". If appreciated, I could make a PR, where the new parameter would be evaluated in the block following Line 156 in 9696bf1
|
@schapsl - sorry for the long wait. Yes, please go ahead with a PR. |
Some other languages like Java and Kotlin have an option in the formatter to "Keep Line Breaks" while reformatting.
This does not mean that for example if you have 3 blank lines, they are preserved, those get reduced.
But this option is effective on some other places.
It would be great to have also such an option for Asciidoc.
Where I right now wish it would be considered is for "One sentence per line".
Germans tend to write much longer sentences than Englishmen.
I usually prefer to split the sentence to multiple lines around 80-100 characters.
So for example formatting with "One sentence per line" this:
would always produce
like now.
But formatting
would stay like that with the new option enabled, while currently and without the option it would be changed to
The text was updated successfully, but these errors were encountered: