Fork me on GitHub
#emacs
<
2020-12-02
>
Zor03:12:59

How can I paste code without parinfer rebalancing all parens ?

hkjels07:12:36

I don’t use parinfer, but from the name, it sounds like that’s exactly what it does. You could just turn it off

practicalli-john10:12:50

Parinfer infers where the parens should go based on the position of characters. So I assume you would have to write an Emacs lisp function to wrap the paste command that disables parinfer, then calls the usual past command and then enables parinfer again. Although I assume parinfer will still update the pasted code at some point, especially if you edit it. I prefer using structured editing as I like to control the structure of my code. I use smartparens in strict mode, it works very well and is unobtrusive https://github.com/Fuco1/smartparens

Zor16:12:31

Thanks for the pointers!