Fork me on GitHub

Hi, i saw the same question was asked a couple of times in the past, but no easy solution: is there a way to clear the repl search history? I have a few large blobs of data in there, and the search history has become unworkably slow. The repl search history is essential, so it’s rather important that it works smoothly…

👍 1
Rachel Westmacott12:08:53

one ugly workaround would be to turn the REPL history size down to 0, and then perhaps you can increase it again once it has forgotten what you did. (I haven't tested this!) downside is you'll lose the rest of the history.

👍 2

thanks, I’ll try that when it happens again. Half an hour ago the big blobs fell out of the history, so things work as normal again…


I have a plan to do this, but I haven’t got around to it yet, sorry.

Rachel Westmacott12:08:14

Is there a way to hook into the way specific types get printed at the REPL? It says it will pretty print in the settings, but if I modify the clojure.pprint/simple-dispatch multimethod it seems to ignore what I've done. (vs. eg. calling pprint manually which does pick up the change)


There isn’t at the moment, unfortunately. The way this works is that Cursive assumes that the form returned is (roughly) readable, then it will parse it using a similar mechanism to the one it uses for parsing normal code. That representation is then pretty-printed with fipp, and that process can’t be controlled at the moment. However, if you override printing on the server side to output a Clojure representation of e.g. a Java object, a record or something, then those customisations should work.

🆗 1

If that doesn’t mesh with what you’re trying to achieve, let me know and I’ll see if I can help work out a solution.

Rachel Westmacott12:08:12

Also while I love the 'Add forms sent from editor to REPL history' being disableable, it would be nice if when it was off there was some sort of feedback when you send a form to the REPL. I occasionally send some long-running things to the REPL and would aid user-confidence if there was some immediate feedback.

👍 2
Rachel Westmacott12:08:53

I really like not seeing the whole form printed in the output pane though, so I don't want that.


What if the form sent to the REPL was folded up by default?


That sounds like it might be a good option. Note that that option also disables the forms being added to the history, not just them being printed in the output. I’m not sure what other sort of feedback might be appropriate, it seems like you’re looking maybe for some kind of spinner saying that something is being evaluated? That’s been suggested before.