Fork me on GitHub
#parinfer
<
2016-04-14
>
sekao17:04:50

my new strategy for cut/paste events is to run paren mode and then indent mode. that way, it will first correct indentation if possible, then it will fix unbalanced delimiters

sekao17:04:27

previously i was running indent mode alone, which was messing up since pasting a multi-line form in a REPL (or sometimes in the editor) caused it to mess up the form because the prompt caused the first line to separate from the rest of the form

sekao17:04:15

the fix is in the latest nightcode and paren-soup, seems to work well so far but there may be things i overlooekd

shaunlebron20:04:35

@avi yeah ill pair with you for a session or two 🙂

shaunlebron20:04:51

im in seattle for clojurewest too

shaunlebron20:04:00

@sekao cool. paren mode will only work if parens are already balanced actually. mfikes sort of modified it work without being fully balanced for the purpose of autoindent in planck

shaunlebron20:04:13

i'll look into adding that as an option since this is a good strategy for copy paste

shaunlebron20:04:33

ah thats not what we want then

shaunlebron20:04:28

i think i can make it emit a partial result

sekao20:04:48

@shaunlebron: yeah i knew it only worked with balanced parens. the logic i wanted was essentially “fix indentation if the parens are balanced; otherwise, balance the parens"

shaunlebron20:04:45

ah i see. sorry i misread your first message

shaunlebron20:04:17

yeah that seems like a good strategy. will try it out

shaunlebron20:04:37

@sekao you attending clojurewest?

sekao23:04:16

@shaunlebron: sadly no =\ my fellow charlestonian ghadi will be speaking there so i was tempted but couldn’t justify the travel expense. i’m determined to make it to the conj this year though

snoe23:04:37

@sekao that sounds like the hybrid mode that I put into nvim https://github.com/snoe/nvim-parinfer.js/blob/master/src/nvim_parinfer/main.cljs#L28-L32 sadly, it then requires slurp and barf from paredit to be usable.

snoe23:04:28

it helped pasting a lot!