Skip to content
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

Added option to render styles with optional separator #249

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SuperJura
Copy link

The problem with the current implementation is that you cannot modify the rendering of the styles when you have multiple lines to render.
The only way to render multilines is having "\n" between the lines. That is not only cumbersome, but has bugged view with extra space character at the start of every new line.
This PR fixes this.

this is how it looks when rendering code
lines = []string{ "first line", "\n", "second line", }
image

this is how it looks when rendering PR code
lines = []string{ "first line", "second line", } ... style.RenderWithSeparator("\n", lines...),
image

@SuperJura
Copy link
Author

This can also be done with current code and passing one string with "\n" or some other separator, but if the API already supports multiple lines, this feels like correct way to connect the lines.

@meowgorithm
Copy link
Member

Hi! Thanks for this—it's interesting and your implementation is great. We're going to consider it, though do note that we're generally cautious about increasing API surface area.

@SuperJura
Copy link
Author

great, let me know what you decided.

@SuperJura
Copy link
Author

any news about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants