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

Formatting form with comma whitespace inserts 0 and places the cursor wrong #1370

Closed
introom opened this issue Oct 31, 2021 · 4 comments · Fixed by #1371
Closed

Formatting form with comma whitespace inserts 0 and places the cursor wrong #1370

introom opened this issue Oct 31, 2021 · 4 comments · Fixed by #1371
Labels
bug Something isn't working formatting

Comments

@introom
Copy link

introom commented Oct 31, 2021

(
<Cursor>
,)

type the Tab key, gives

<Cursor>
(0)

Note the comma in ,) is intentionally left there.

@PEZ PEZ added bug Something isn't working formatting labels Oct 31, 2021
@PEZ
Copy link
Collaborator

PEZ commented Oct 31, 2021

Thanks!

I've seen similar things, but never such a minimal repro.

@PEZ
Copy link
Collaborator

PEZ commented Oct 31, 2021

FYI. If you are using the comma to try keep the closing paren in place, that won't work anyway. The formatter removes surrounding whitespace. It's probably why we have that bug, actually, coming to think of it.

@PEZ PEZ changed the title Weird indentation Formatting form with comma whitespace inserts 0 and places the cursor wrong Oct 31, 2021
@PEZ PEZ linked a pull request Oct 31, 2021 that will close this issue
11 tasks
@introom
Copy link
Author

introom commented Nov 1, 2021

Yes, the comma is intentionally put there. I learned this trick from Sean Corfield's talk on repl development: https://www.youtube.com/watch?v=gIoadGfm5T8&t=957s

@PEZ
Copy link
Collaborator

PEZ commented Nov 1, 2021

Still, it won't work in Calva. And since a while no such tricks are needed in (comment ...) blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants