Fork me on GitHub
#vim
<
2016-11-04
>
dominicm08:11:05

@snoe my clojure operators and objects work there, which usually cover most of my needs, otherwise I use a scratch buffer or similar.

snoe18:11:36

@ingvij is it possible to expose the current buffer's namespace through acid right now? (like fireplace#ns())

snoe18:11:30

acid_namespace is different I think; always user for me

hkupty18:11:02

👍, acid.nvim.path_to_ns

hkupty18:11:42

acid will use user whenever ns isn't specified, so it'll always make use of already required data.

snoe18:11:00

a bit less than https://github.com/tpope/vim-fireplace/blob/master/plugin/fireplace.vim#L561 😮 the fireplace code was a bit too dense for me to port. Would it be worth exposing path_to_ns as a @neovim.function ?`

hkupty18:11:26

Well, it does a bunch more actually.. I'm ok with exposing that as a function, but why simply not import it?

snoe18:11:21

I'm not using python

snoe18:11:42

or maybe I'm missing something

hkupty18:11:19

I see.. Then it'll probably be trickier to implement a command or a handler, if that's the case

dominicm18:11:29

Not sure how it would work with callbacks from python.

hkupty18:11:24

@dominicm as of now, there is no proper way, but I can probably have a handler to call a vim function/command with the returning data from the repl.. That'd be pretty straightforward and would solve the problem for handlers

hkupty18:11:59

commands are just a quick way to bind a vim command to a functionality (that will ultimately be handled by a handler). That can surely be circumvented by wrapping a user command around AcidSendNrepl.

dominicm19:11:23

That should probably work as I think about it. I think. Can you register anonymous functions in node host as a callback?

snoe19:11:46

not really, but I think maintaining state for message ids in flight and dispatching accordingly in a generic handle_message function would be doable

hkupty19:11:36

I think it's worth mentioning that acid will only call your handler for the correct message id