cursive

Issues at: https://git.io/cursive-issues
gscacco 2021-04-10T11:50:05.187700Z

Hi all. If I select some part of a s-expression including parenthesis (even not balanced) and press del, cursive deletes the selection generating a not-balanced s-expression. From here I can't find any way to re-balance parenthesis. Is there a way to solve this problem ? Thanks

armed 2021-04-11T08:47:20.193300Z

Sometimes I manually select closing paren, copy it to buffer and paste somewhere else to achieve balance. I know it’s dirty technique, but works.

katox 2021-04-12T07:56:21.194Z

the dirty solution to unbalanced parens with cursive paredit is just copying and pasting closing parens

👆 1
raspasov 2021-04-12T13:16:09.194300Z

In addition to “Extend Selection” + backspace, you can also simply “backspace”; With paredit (what I use) it always does the right thing (at least from my perspective); But I agree coming from another language it can be tempting to hold Shift + arrow keys to select portions of the code; Just don’t 🙂 It can take a few weeks to break that muscle memory; I’ve forgotten those times so much that now it’s super hard to code without at least “Extend Selection” in another language; For example, XCode doesn’t have “Extend Selection”, so if I have to write Swift, I use AppCode (by IntelliJ) and use Extend Selection, copy/paste/delete all the time (since there’s no easy+proper structural movement).

raspasov 2021-04-10T11:56:44.187900Z

Don’t select expressions manually; I personally use “Extend Selection”

raspasov 2021-04-10T11:57:41.188100Z

(with a keyboard shortcut attached, ofc)

gscacco 2021-04-10T12:03:18.188300Z

👍

simongray 2021-04-10T12:06:33.188500Z

use parinfer

dpsutton 2021-04-10T14:41:28.190700Z

If using paredit you can insert a new balanced pair of parens and then highlight and delete one to leave you with the desired paren to help balancing. But the advice to never get into this state is the more correct way to manipulate forms

simongray 2021-04-10T14:46:12.190900Z

All I know is that as long as I keep auto-indenting while using parinfer, I can quite casually highlight and delete most stuff and It Just Works(tm) 😉