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

nimpretty doesn't indent correctly if preceding line ends with `;`, `{` etc #10159

Closed
timotheecour opened this issue Jan 1, 2019 · 1 comment

Comments

@timotheecour
Copy link
Contributor

commented Jan 1, 2019

before

proc fun() =
  discard

proc main() =
    echo "foo"; echo "bar";
    discard

main()

after

proc fun() =
  discard

proc main() =
  echo "foo"; echo "bar";
    discard

main()

expected

proc fun() =
  discard

proc main() =
  echo "foo"; echo "bar";
  discard

main()
@kobi2187

This comment has been minimized.

Copy link
Contributor

commented Jan 9, 2019

also happens with other characters at end of line, such as { or &
A few examples from my code:
for the procs that happen later, their body gets the same indentation.

let caption_regex*: Regex = re(r"\[caption[^\]]*\](.*)\[/caption\]", {
reDotAll, reIgnoreCase
})
proc mkReplacement(img, text: string): string =
 r"""<p class="splitted image-container"><span class="section">""" &
  img & "</span>" &
  r"""<span class="section">""" & text & "</span>\n</p>"

@timotheecour timotheecour changed the title nimpretty doesn't indent correctly if preceding line ends with `;` nimpretty doesn't indent correctly if preceding line ends with `;`, `{` etc Jan 10, 2019

@Araq Araq closed this in 12fc1df Jun 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.