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

Fixup multisnippet indent #201

Merged
merged 1 commit into from
Jun 15, 2018
Merged

Conversation

2m
Copy link
Contributor

@2m 2m commented Jun 8, 2018

This adds indent tracking at the start of the block. This indent is then removed for every line of the block. The result is evenly indented multi-snippets even when the original code has different indentations for different snippets.

Copy link
Member

@ennru ennru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eed3si9n eed3si9n merged commit eebbe45 into lightbend:master Jun 15, 2018
@2m 2m deleted the wip-multisnippet-indent-2m branch June 15, 2018 07:09
@pvlugter
Copy link
Member

Nice one

@2m 2m added this to the 0.3.4 milestone Jun 21, 2018
@JustinPihony
Copy link

@2m is there a usecase for this which we can review when fixing up the overindentation issue?

@2m
Copy link
Contributor Author

2m commented Jul 30, 2018

The newly added test-case exercises that code: https://github.com/lightbend/paradox/pull/201/files#diff-8d79ec1d035f6c1d99a65339227c81a2R85

Also any multi-snippet that has different indentation, like here. The imports and the code have different indentation, but the rendered result has same and correct indentation.

ennru added a commit that referenced this pull request Sep 11, 2018
This rolls back the snippet indentation logic introduced by #201. But has special handling for `import` lines, so that they become aligned with the left-most code in other snippets with the same label.

Relates to:
akka/akka#25564
#242
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.

5 participants