Fork me on GitHub
#cursive
<
2020-03-14
>
Daniel Slutsky14:03:59

Hello all. Happy to join this channel. Wanted to ask about extending cursive: how hard would it be to add a cursive command that runs some clojure code (f l) at the REPL, where f is some pre-configured clojure function, and l is the current line at the editor?

Daniel Slutsky14:03:08

The reason I'm asking is that I want to support some basic integration with notespace (https://github.com/scicloj/notespace).

jumpnbrownweasel15:03:37

did you see the REPL commands section here?: https://cursive-ide.com/userguide/repl.html

jumpnbrownweasel15:03:31

I guess you can't get the current editor line.

Daniel Slutsky15:03:46

It does allow getting some other information that I might be able to work with. 🙏

cfleming02:03:31

If there are other things that it would be helpful to have substitutions for, please file an issue and I’ll get them added.

👍 4
flowthing20:03:06

Just noticed that trying to format a form like this gets pretty wonky:

(defn foo
  [{tx :db/tx {:strs [from until]
               :or   {from 1
                      until 2}} :query-params}])

flowthing20:03:20

If you have :strs and :or on the same line, everything's fine.

flowthing20:03:34

Not really a big deal, though — just happened to notice it.

cfleming08:03:54

What’s weird there, that the map values are aligned?

flowthing05:03:10

I mean that if I copy-paste that form into Cursive and then run the Reformat code action, it gets a bit wonky

flowthing05:03:11

It becomes:

flowthing05:03:12

(defn foo
  [{tx                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      :db/tx {:strs     [from until]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       :or {from  1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            until 2}} :query-params}])

flowthing05:03:13

There's basically many, many spaces between tx and :db/tx.

cfleming09:03:40

Ah, ok, thanks, that was what I needed - I’ll try to reproduce that.