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

Indentation inside namespaced maps is wrong #274

Closed
miridius opened this issue Nov 3, 2022 · 2 comments
Closed

Indentation inside namespaced maps is wrong #274

miridius opened this issue Nov 3, 2022 · 2 comments

Comments

@miridius
Copy link

miridius commented Nov 3, 2022

When a namespaced map goes onto multiple lines, I've noticed 2 issues:

  1. The keys on lines after the first are indented relative to the namespace name rather than the opening {
  2. If there is another map nested inside the first one, which also goes onto multiple lines, then the lines after the first are indented the amount they would be if the enclosing map had been indented correctly. This makes them look wrong even though in some sense they're the only lines that are actually indented correctly

Example demonstrating both issues:

#:foo{:aaaaaaaaaaaaaaaaaaaaaaaa 1,
 :bbbbbbbbbbbbbbbbbbbbbbbb {:aaaaaaaaaaaaaaaaaaaaaaaa 1,
                                 :bbbbbbbbbbbbbbbbbbbbbbbb 2,
                                 :cccccccccccccccccccccccc 3},
 :cccccccccccccccccccccccc 3}
@kkinnear
Copy link
Owner

kkinnear commented Nov 4, 2022

Wow, that's not good. Thank you so much for reporting this, I have no idea how this slipped by. Namespaced maps have always been a problem, in part since the parser didn't support them explicitly until fairly recently, so I had to try to work around that. Plus they don't seem to get used much, I think.

I've reproduced and possibly fixed this now. I need to do a bunch more testing before I'm sure I really got it, but I've at least found the right place to focus on. The fix for this will be in 1.2.5, which I keep thinking I'll have out soon. That said, I'm currently working on a very involved and widespread problem regarding repeatability of formatting -- where if you format a file once and then do it again, it sometimes (rarely) changes the second time. I have a good bit of work to do to finish the multiple fixes for that problem, so it will be a few weeks at best before 1.2.5 comes out.

Thanks again for noticing and reporting this!

@kkinnear
Copy link
Owner

This is fixed in 1.2.5.

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

No branches or pull requests

2 participants