-
Notifications
You must be signed in to change notification settings - Fork 49
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
Config option to inline short threading macros in function bodies #335
Comments
Yes, there are a variety of ways to achieve what you want. The simplest is to simply remove the special processing for
That is the simplest approach. There are function types which will recognize a function with greater than 2 or greater than 3 arguments, and place those on multiple lines even if they would fit on one line. If you want to pursue that approach for the Thanks for asking! |
Hi @kkinnear! Me again. 😅 I had the same issue, but with the thread-first macro. This one is super irritating because it's not just a matter of style/readability. See, there is also a hidden performance penalty when using
Not much, admittedly, but this realization hurt me every time I have to rewrite For me, adding a The initial minimalistic
The test ns — like that:
With this modified
Both Quite surprisingly, removing a Having the following modified
Results in new lines being added inside the
This is probably a matter of misplaced expectations or a real bug, I don't know. Maybe you can shed some light here. |
But then, on a real world project with a more complicated Here's the complete
And here are some of the issues I face with it. A
|
And one more thing. If we, say, go with an The modified
The results in the aforementioned three cases:
With no re-formatting upon a subsequent |
@kkinnear The only workaround that I'm aware of is to use "guides" ( |
There is a lot going on here, and I have not yet fully digested it. Let me respond first to the basic problem with What is going wrong with your approach using In addition, while you get extra-credit points for using So, that approach (i.e., dropping into What I think might work well is to simply drop the formatting for
I think that would solve your problem much more easily than anything else would. On the other hand, you are clearly a power user and so maybe you tried that and it didn't work for you. If so, let's pursue that approach and not mess with Also, you said: "Quite surprisingly, removing a :noarg1-body value from the :fn-force-nl set, didn't work for me as expected." Indeed it didn't, because while it looked as if you might have removed So, that was a good idea, and it also works:
Either approach would be a good way to handle It is unfortunate that handling sets is kind of complicated, but I didn't know of any better way to allow people to add things and remove things from sets without (as you tried to do) specifying the entire set every time it was changed. That just didn't seem to be a reasonable approach. That's what I have time for now. I'll look at the rest of this issue tomorrow. Thank you for your patience with all of the complexities in the configuration. |
Oh, right... You have reminded me of that "sets thing" (semantics) that I remember reading about in the docs when touching |
The With regards to the other proposed solution — leveraging the
it ended up being formatted like that:
Which is definitely not what I would expect for While the
|
I'd like short threading macros in function bodies to occur on a single line - is there a config option for this?
Preferred:
Actual:
I'm currently using the community style settings with :justified and :respect-nl.
As an aside, thanks for the great software! :)
The text was updated successfully, but these errors were encountered: