Fork me on GitHub

I think maybe atom has this


In the demo editor, what is indenting the cursor on the ned line when I type something like (-> foo|) and hit enter, to get

(-> foo
? Is it Parinfer?


The closest I get with only Parinfer is:

(let [o (jsify {:cursorLine 1
                :cursorX 0
                :prevCursorLine 0
                :prevCursorX 8
                :changes [{:lineNo 0
                           :x 8
                           :oldText ")"
                           :newText "\n)"}]})
      result (parinfer/smartMode "(--> foo\n)" o)]
  (cljify result))
=> {:text "(--> foo\n )", :cursorX 1, :cursorLine 1, :success true, :tabStops [{:ch "(", :x 0, :lineNo 0, :argX 5}], :parenTrails [{:lineNo 1, :startX 0, :endX 2}]}


Never mind, found this in clojure-parinfer.js:

*    This Clojure mode also has logic for where to indent the cursor when pressing enter.
 *    We do not modify this.


As I am testing out processing the document on cursor move I find that I would like to have some option to get WIP-treatment of my code, where parinfer wouldn’t fold parens. So.

Would become, when I move the cursor up:
Instead of:

Is this very tricky to achieve, or would it break Parinfer in some way? I can file a feature request about it if it is a feasible thing to wish for.


I have this need to get the parens out of the way while I enter some code, but I do want parinfer’s help to be my guardian of the balance. I get a bit distracted by the parens moving back up when I just moved them down, and then they reappear when I start typing. I guess it is a matter of getting used to trust parinfer, but anyway, I don’t want to have a paren fight with my editor.