-
Notifications
You must be signed in to change notification settings - Fork 22
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
Different text depending on line break #50
Comments
I believe you want flat_alt Line 595 in 4a49547
|
Thanks! I'll let you know if it works for me. |
Relatedly, I'm struggling a little bit with nest, which seems to require me to nest a document together, and let it possibly nest the second line and forward. What I frequently want is: nest this whole document underneath this other document. Maybe it's obvious how this is supposed to work and I've just missed it? |
elm-pretty-printer seems to have |
The description of It seems like |
Might be that you are doing |
Adding |
@Marwes I'm pretty sure I'm not doing that, but let me whip up some examples that might help identify where my confusion is coming from. |
@Marwes Here's an example: https://github.com/wycats/gitpod-examples/ The output looks like this: What I'm trying to do is nest the child document, but as you can see it nests the second line of the child document. This is sort of fine, except that it requires me to know more about the per-line structure of the output than (1) I want to think about, and (2) pretty.rs wants me to think about |
Yeah, you need the column document. Started on it at #52 . It is going to be a bit awkward since the function in column needs to produce a new document and the layouting only works with references. So the owned document needs to be stored somewhere while the layouting is done. |
For my use-case I'm not too worried about the ownership issues. That sounds perfect. |
The ownership issues are fortunately/unfortunately an implementation detail. You don't have to worry about it but the implementation does! |
Released in 0.7 . Let me know if it works for you! |
I want to have a document that outputs a key and a value differently depending on whether the value first on one line:
vs.
In other words, I'd like to change the document in the situation where a line break is deemed necessary. I'd be comfortable with many restrictions, and don't think backtracking is necessary (iow what happens if the new document no longer needs a line break; too bad).
The text was updated successfully, but these errors were encountered: