Open w9 opened 2 years ago
I think I've seen @PEZ discuss this with someone at some point, but I didn't see another issue for it when I looked just now. I'd like to see what he has to say. It seems like a nice feature.
So, there are the "wrap around" paredit commands, mentioned here: https://calva.io/paredit/.
Maybe those commands or the underlying functionality can be used when the related opening or closing character is typed.
Depending on keyboard layout this shortcuts example might help: https://calva.io/customizing/#wrap-using-like-cursive
If we ever get Parinfer to work, we'll get this behaviour.
I really like Cursive's "Surround selection on typing quote or brace" option where one could surround a balanced form by simply typing "(" to the left of the form. i.e., typing "(" at
gives
This is more frequently what I want, as opposed to what's currently done:
This behavior can be implemented by slurping as far as possible after adding that pair of parentheses. So that typing "[" at:
should give
The above behavior is best paired with the behavior that when you type ")", "]" or "}", barfing operation is executed until the cursor is out of the form, that is, typing "]" at
should give
It also means that in order to have the original behavior (paren-balance only), you simply type "(" immediately followed by ")".
https://cursive-ide.com/userguide/paredit.html#:~:text=opening%20a%20balanced%20form%20will%20wrap%20the%20selection%2C%20otherwise%20the%20selection%20will%20be%20deleted%20and%20replaced%20with%20the%20empty%20delimiters.