Fork me on GitHub
#parinfer
<
2016-03-02
>
snoe04:03:40

I've been testing out a simple little "hybrid" mode. It's actually kind of neat, things tend to auto-indent as in paren-mode when you add params or change a fn name, pasting behaves like paren mode paste, but if you are typing at the bottom of a form it behaves like indent-mode.

(if (re-matches #"\s*\S$" current-line)
     (parinfer/indentMode current-text opts)
     (let [paren (parinfer/parenMode current-text opts)]
       (parinfer/indentMode (.-text paren) opts)))

snoe04:03:01

Going to use it more this week to see where the problems lie, but over the last day it's been pretty good to work with.

snoe04:03:49

Pasting unbalanced forms is a no-no

shaunlebron15:03:13

That’s awesome @snoe

shaunlebron15:03:42

I’d like to try that out

shaunlebron15:03:56

can you indent/dedent selected lines with that?

shaunlebron15:03:44

looks like that would only work if there’s only one non-whitespace character on a line

shaunlebron15:03:48

but it’s interesting that it satisfies the use-case of insertion of a new line

shaunlebron15:03:01

I’m starting this demo site to be the canonical place to test Parinfer’s intended behavior

shaunlebron15:03:53

feedback welcome on the new previewCursorScope option

chrisoakman16:03:46

I'm talking with @escherize about integrating with this with CLJS fiddle: http://cljsfiddle.com/