parinfer

sekao 2017-01-26T21:56:53.000022Z

hey all! i finally tried to implement something similar to aggressive-indent-mode that is combined seamlessly with parinfer.

sekao 2017-01-26T21:57:02.000023Z

you can try it out here: http://oakes.github.io/paren-soup/

sekao 2017-01-26T21:57:36.000024Z

if you notice any odd behavior, please let me know. i'd love to integrate with with my various projects but i don't trust it yet 😄

shaunlebron 2017-01-26T21:59:42.000025Z

👍

shaunlebron 2017-01-26T22:00:20.000026Z

looks like it uses two-space indentation as a guide

shaunlebron 2017-01-26T22:03:06.000027Z

for example:

(comment foo
         bar)
[(comment foo
^         bar)]
[a (comment foo
 ^   bar)]

sekao 2017-01-26T22:04:34.000031Z

yeah and one limitation is that it doesn't currently adjust indentation when wrapping a form with delimiters

shaunlebron 2017-01-26T22:04:57.000032Z

it’s tricky

sekao 2017-01-26T22:05:01.000033Z

so if you just keep spamming [ the bar will indeed fall out of the comment block

shaunlebron 2017-01-26T22:07:05.000035Z

@sekao: by “various projects”, how many do you have using this? 😄

shaunlebron 2017-01-26T22:07:22.000036Z

http://nightcoders.net and the nightcode app?

sekao 2017-01-26T22:07:25.000037Z

right now, nightcode, nightlight, and http://nightcoders.net

sekao 2017-01-26T22:07:29.000038Z

hehe

sekao 2017-01-26T22:07:43.000039Z

i should just say night* from now on

shaunlebron 2017-01-26T22:07:49.000040Z

haha

shaunlebron 2017-01-26T22:08:22.000041Z

they all use nightlight? https://github.com/oakes/Nightlight

sekao 2017-01-26T22:09:12.000043Z

http://nightcoders.net does. nightcode uses paren-soup on its own

shaunlebron 2017-01-26T22:11:56.000044Z

oh okay, so this is implemented inside paren-soup, which uses a custom parinfer from cross-parinfer

sekao 2017-01-26T22:12:08.000045Z

yep

sekao 2017-01-26T22:12:53.000046Z

the code for this particular feature is pretty awful right now but basically i'm using the same info from tools.reader that let me get accurate tab stop information

shaunlebron 2017-01-26T22:13:20.000047Z

accurate?

shaunlebron 2017-01-26T22:14:23.000048Z

i thought about revising the tab-stop part of the API: https://github.com/shaunlebron/parinfer/issues/125

sekao 2017-01-26T22:14:28.000050Z

well im not sure how it compares to the tab stop info you added, i think i implemented mine beforehand. i actually haven't tried just using the info from parinfer

shaunlebron 2017-01-26T22:15:49.000052Z

i think it’s too customizable to make sense, but it was only returning the positions of the parent open-parens, and expecting the user to insert the indentations between them according to preferences

shaunlebron 2017-01-26T22:17:02.000053Z

i have to head out, but I’ll look at cross-parinfer to see what we can merge back to core if appropriate

shaunlebron 2017-01-26T22:17:26.000054Z

excellent job on night stuff 👏

sekao 2017-01-26T22:17:32.000055Z

thanks!

cfleming 2017-01-26T22:58:54.000056Z

@sekao Great, I will definitely try that out.

cfleming 2017-01-26T22:59:15.000057Z

What are the rules you’re using to decide when to run paren or indent mode?