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

fix: Adjust Indent Position #74

Merged
merged 1 commit into from
Sep 27, 2024
Merged

fix: Adjust Indent Position #74

merged 1 commit into from
Sep 27, 2024

Conversation

notJoon
Copy link
Contributor

@notJoon notJoon commented Sep 27, 2024

Description

Improve snippet formatting by removing common indent prefix from code lines.

  • Modify AddCodeSnippet builder function to remove the common indentation before displaying each line.
  • Adjust underline positioning to match the new indentation:
    • Update AddUnderlineAndMessage to account for the removed indentation level.

Before

Simplified output; dots are indicates the indentation

 1 | ....if foo() {
 2 | ........println()
 3 | ....} 

After

 1 | if foo()
 2 | ....println()
 3 | }

@notJoon notJoon added the T-format Type: related with formatter label Sep 27, 2024
@notJoon notJoon self-assigned this Sep 27, 2024
@notJoon notJoon merged commit 49c75b0 into main Sep 27, 2024
3 checks passed
@notJoon notJoon deleted the adjust-indent-pos branch September 27, 2024 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-format Type: related with formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant