This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-08
Channels
- # admin-announcements (3)
- # alda (2)
- # beginners (66)
- # boot (54)
- # cider (21)
- # clara (1)
- # cljsfiddle (32)
- # cljsrn (9)
- # clojars (4)
- # clojure (164)
- # clojure-dusseldorf (4)
- # clojure-japan (2)
- # clojure-norway (1)
- # clojure-russia (76)
- # clojure-sg (8)
- # clojurescript (19)
- # core-async (1)
- # core-typed (1)
- # cursive (6)
- # datomic (1)
- # editors (48)
- # hoplon (20)
- # immutant (2)
- # jobs-discuss (6)
- # ldnclj (1)
- # om (82)
- # onyx (6)
- # parinfer (11)
- # proton (2)
- # re-frame (113)
- # reagent (17)
- # testing (11)
- # untangled (11)
- # vim (4)
- # yada (38)
I've finished installing parinfer.. It was tricky. I'm stuck however when it comes to being able to toggle between parinfer-clojure
and clojure
modes with CodeMirror. @chrisoakman @shaunlebron Do you guys have any pointers?
Shaun would probably know; I haven't worked with CodeMirror
Is that like a language-pack setting?
I'm not sure what a language-pack setting is, however those modes are codemirror options. When reloading the component that hosts the textarea I'm using to create the codemirror instance, the codemirror instantiation code doesn't run. I think it's because of this: https://gitlab.com/escherize/cljsfiddle/blob/codemirror-with-parinfer/src/cljs/cljsfiddle/parinfer_codemirror/example.cljs#L44
small trick: I would replace (js/document.getElementById element-id)
with (by-id element-id)
and just create a by-id
wrapper around the native DOM call
less verbose
sounds good. Untill I can toggle parinfer on/off (some of the repls do... I can't figure it out though), I'll keep the codemirror instance with clojure
mode.
hmm, I didn’t realize that parinfer-codemirror was just using code from the website
I was hoping it was a proper codemirror plugin instead of the wrapper that I used to tightly control the state just for animations
regardless it’s what we have...
@escherize: use cm.setOption
to change the mode: http://codemirror.net/doc/manual.html#setOption
hey @shaunlebron - oh wow is that really all it takes?
cm.setOption(“mode”, …)
I think so
I always kept a reference to it in a lookup atom by id
but there’s only one in cljsfiddle, so just save the cm instance somewhere when creating it
@escherize: https://gitlab.com/escherize/cljsfiddle/blob/codemirror-with-parinfer/src/cljs/cljsfiddle/state.cljs#L10
(-> @state editor-key :cm)
I’ll look at this more tomorrow. gotta go to bed
great stuff man!
Thanks - I've noticed that changing the mode didn't actually change the parinfer-y behavior of the editor, though. We'll catchup on it tomorrow
@escherize we have a code mirror + re-frame lib coming out soon but still in the making, hopefully next week we will publish it ok?
parinfer-clojure
is just a modification of clojure
that allows us to highlight close-parens at the end of a line differently
all the parinfer events are manually attached to the cm events
parinfer is not a proper codemirror mode