-
Notifications
You must be signed in to change notification settings - Fork 26
[FEATURE REQUEST] Every sentence on new-line for readability and maintainability #133
Comments
Hey there :) We could simply add a newline after each single This should be feasible |
Thanks for the quick response! Maybe I'll look into proposing a pull-request myself, if this feature doesn't have that high of a priority. Im not as familiar with the codebase just yet, so i'll have to learn, but im loving using the formatter anyways! |
Thanks for your kind words ❤️ I'd ideally like to work on it myself but unfortunately, I'm spending lots of my energy looking for a job right now so PR's are very encouraged ;) |
Now that I think about it a bit more... Maybe if we accept this feature request, it would be not good to also split long sentences by newline in the middle. The reason that every sentence on a newline is nice is because you get a certain style guide and certainty. If you still want to have the long sentences being broken up, you can just turn on word wrap (in visual studio code). But I also understand the need to support people that don't use IDE's that have these features. But splitting sentences in the middle also makes for a pretty square end result. I would love to hear, your thoughts on this. |
Long in number of lines? I actually think it would be pretty okay to have both (especially since the default line length is quite long and configurable.) It would be a bit subtle and possibly hacky to have both at once though so I'm not sure If I actually want to support that 🤔 |
I was going to request this feature as well. There is some relevant discussion here for vimtex (a comprehensive vim package for LaTeX which includes its own |
lot's of abbreviation in fact yes, good remark! Maybe we should only split on |
That's closer, but it still doesn't work for |
Hmm 🤔 anyone has an idea? what is a sentence? 🤣 |
This project may give some ideas. For a quick solution it may be fine to implement your initial idea with a few manual exceptions (e.g., don't break after |
There's also the possibility/need to let the user add manual exceptions via the config file! |
It starts to get complicated if we want to support multiple languages tho :(
|
You are absolutely correct. A "good enough" solution for me would be a configurable option for typstfmt to just not reflow my paragraphs since I'm already so used to manually writing one-sentence-per-line. |
That's actually already the case, you can use |
Maybe I'm missing something in the documentation but where am I supposed to place Edit: I found it! (via |
there's also |
Currently as of version 0.2.7 (46b4ec3)
Long sentences get split up by adding a newline in the middle. Which is good.
But I would also like to have every sentence on a newline, since this won't impact paragraphs in Typst (same for LaTeX).
Normally I do this manually, I scroll trough the file and put a newline behind every period.
I would be nice if the formatter did this automatically.
The text was updated successfully, but these errors were encountered: