-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Paredit allows typing of closing, unbalanced parenthesis #1075
Comments
Hello. Happy to hear you are enjoying Calva! It is not on purpose. Just never dealt with. |
Just realized that this is a duplicate of #650 . But let's keep this open anyway. So far I can report that this is not as easy to fix as I first thought it would be. VS Code doesn't really provide a way to catch input before it has updated the document. And just removing the brackets after the fact sometime conflicts with VS Code settings for preventing extraneous closing brackets... Right now I am experimenting with deleting the bracket, then figuring out if it should be re-inserted. We'll see where that lands me. 😄 |
It doesn't seem to be possible to fix this properly. I've chosen to add a setting where the user can opt in on having some protection against it. See #1099 for details. Here's a VSIX with this implemented: https://12588-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.185-1098-paredit-quality-9eaa60a3.vsix Please give it a spin and let me know if it works or causes trouble of any kind. |
Thank you very much, I really appreciate your time spent on this! With the setting enabled, it looks good to me, works as expected for me 👍 Even better, as unmatched parens can be easily fixed that way (e.g. after copying an incomplete form on accident. Also with the setting disabled, it seems like I no longer need to force delete unmatched parens, right? No troubles caused until now, thanks again! |
Thanks for testing it so swiftly! Yes, as part of this fix we now do not offer bracket protection in unbalanced documents. Since unbalance throws Paredit out of whack we can't offer any accurate protection anyway. Note that in this state you can remove any bracket, not just the unmatched one, but hopefully the highlighting of the offending bracket should help in targeting the right one. I think I might have found a way to deal with the situation when there is a selection, which would allow us to enable this by default, but we'll run like this first and see what people think about it. |
Thank you very much for this project, I recently switched from Emacs and I am loving it so far!
I realized, that with Calva I am allowed to type ], ) or } in the editor. I am a little clumsy while typing, so it happens quite often to me. This produces an unbalanced parenthesis, which is immediately marked as an error. In the editor, I am not allowed to delete it with backspace, although ALT+Backspace works.
The default mode in Emacs' paredit prevented me from typing these characters entirely. which makes sense to me, as there should be no reason to create unbalanced parens in Clojure at all.
Is this something it does on purpose? If so, would it be possible to create a setting to change this behavior?
The text was updated successfully, but these errors were encountered: