And solved.... ๐
During the hackday framed-input UIs (eg notebooks) were discussed at length.
@andrea712 ^^
We came to the conclusion to use (eval (read-str โuser inputโ))
The issue is that by doing so all exceptions become evaluation-time exception
So this piece of information that unrepl provides (the :phase
key) is useless
This is another point in favor of finding a way to break unrepl in some pieces that can be reused in user code.
Arentโ phase prefixes for debugging?
well, if you get :phase :read
you can report to the user that his/her input is malformed
if you get :phase :print
you can report that something fishy happeneed and that the dev team has been alerted ๐
:phase :eval
thatโs user fault
ah, ok thereโs a phase key in the :exception message
@dominicm You asked for code to follow. I also pushed now to the dark side for non-mercurials: https://github.com/kotarak/vimpire
The repl prints now exceptions in fashion inspired by the yesterday mentioned pyro.
Output now doesn't interfere with the prompt anymore.
So (future (Thread/sleep 5000) (println "BTOOM"))) doesn't mess up the prompt.
I need to test this. Will it break fireplace?
dunno
It's very rough.
cmpletion doesn't work, yet
oh, and it's not very well tested.
No, for sure. I'm just curious of both: 1) What was VimClojure like? (I've only ever used fireplace!) 2) How does this feel in practice. I suspect that it's going to feel really different to what I've become used to.
I provides some hooks, which you may define as you like. For keyword lookup, code eval, etc.
And I built-in repl. Which can now read from stdin. Hooray.
The lookup things open a window too display the result.
That may mess up your layout.
I don't care too much, so it's okay for me.
OT: Do you happen to know, how these gifs are made, which one can often find in the READMEs of a lot of plugins?
I could create a demo.
I was never happy with fireplace.
It had tons of annoying bugs.
@kotarak asciinema maybe?
screenkey (linux) is quite popular, or screenflick which it apparently copies. (mac)
Ah. Will have a look.
I've used ffmpeg to record things before.
@kotarak what bugs have you found in fireplace? I've found it very stable overall.
In the beginning you couldn't eval a function with a comment. Because it put everything on one line.
Then you lost the line and file info. Because it put everything on one line.
But hey! It's superior to that other sucky plugin, which even provides a repl.
But I'm probably biased.
And that were the early days. Don't know how it is today.
It doesn't do that anymore ๐. That's for certain. It has quirks though. But that's "legacy" from nREPL days.
Here is a short demo: https://kotka.de/vimpire/Small_vimpire_demo.webm
Badly clipped. ๐
And typos. ๐
Anyway. It shows how to run the venom generation. In case you want to play around.
@kotarak you should share it with #vim!
Not yet.
It's not really useable right now.
I'm right in the middle of the transition to unrepl.
They'll get a kick out of knowing it's in progress.
This is really cool!
Well, except for the future and (read) this is VimClojure's funtionality from five years ago....
My only ask is that you provide an operator for evaluating a text object, because I use vim-sexp and I like doing things like cpaF
it's cool that this is working. The REPL buffer is new.
No, it's not.
The repl buffer was there from the beginning. With the limitation, that you could not read from stdin.
This is now fixed. Thanks to channels and unrepl. ๐
I mean, it's new to me from fireplace
From fireplace's README: "You know that one plugin that provides a REPL in a split window and works absolutely flawlessly, never breaking just because you did something innocuous like backspace through part of the prompt? No? Such a shame, you really would have liked it."
Hehe.
Regarding your question: So you want an operator which takes some text object/motion(?) for eval?
It has that for line, paragraph, visual block and toplevel.
It's probably better to provide a generic eval-this-thingy and ways to provide this.
Although, I personally never ever needed something except EvalToplevel.
@kotarak I do weird things like oh, what's the value of XYZ
and evaluate the symbol under my cursor.
Yeah. That almost never works, does it?
It works in 2 situations, 1: constants referenced, 2: when I have https://github.com/gfredericks/debug-repl on, which lets me "pause" inside a function.
In some ways, I just like the idea of vimpire separating operation from object though. It's a bit of a purists view though.
Yeah. That's probably the better approach.
The code base is ten years old now. Has some closets to clean out. ๐
This debug-repl was not possible before. But now, that we can hijack the repl.....
It could work. I'd have to have a look.
Hrm. There seem to be some redraws due, although vim states otherwise.
As I said: things are still shaky.
There's now also https://github.com/vvvvalvalval/scope-capture which is a bit simpler.
Indentation is also wrong in the repl buffer. sigh