-
Notifications
You must be signed in to change notification settings - Fork 7
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
Any way to automatically limit comment line width in racket files to a certain value? #43
Comments
The answer is currently no. The problem is that I don't know how to break comments up.
|
Thanks for the quick answer. Understood. |
If you're happy with a semi-automated version and you're using DrRacket, Alex Harsanyi wrote a quickscript to justify text in comments: https://github.com/Quickscript-Competiton/July2020entries/blob/master/scripts/format-selection.rkt It's part of the quickscript-competition-2020 package: |
Thanks @Metaxal. My editor is Vim, which happens to have a fairly well working all-round solution for re-flowing comments. Unfortunately, vim-racket shortcuts it by redefining For now, I'm using smcindent as Other than that, I am using Racket as an interpreter for IEEE Scheme (working though SICP), and I really love the fact the the Racket community maintains such an interpreter. This is extremely valuable! |
Ah, that should be fixed then. |
@sorawee, since you are so kindly reopening, let me try to reproduce the error case I am describing with a minimal example:
Please note that after the first
That is when pressing |
@sorawee You could only add line breaks to comments, and never remove them. So comments that are too long get split, but lots of short comment lines don't get merged. That would preserve ASCII art unless the art is too wide, which seems like a reasonable compromise. |
When it comes to output issue when the input has an error (should that be moved to a separate issue?), I can confirm two things:
So, in fact, the situation is a little frustrating because it would be really easy to work around the issue of non-usability as a formatting filter if only the program would output the entire input to standard out (or the actual file if Unless there is a solution for this in the short term, my plan is to write a Bash script that basically will do what I describe above, based on the The comment issue is actually less crucial for me, since I can rely on Vim for that. |
Assuming a very long comment line in a racket file, like:
I would assume running
raco fmt
on such a file would chop the comment to chunks of 80 characters (the defaultraco fmt
line width), but that does not seem to happen, although other formatting is taken care of. Any way to get such auto-formatting? I am running racket 8.8.The text was updated successfully, but these errors were encountered: