File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 55 [clojure.core.async :as async]
66 [clojure.java.io :as io]
77 [clojure.string :as string]
8+ [clojure.tools.namespace.find :as namespace.find]
89 [clojure.tools.logging :as log]
910 [neovim-client.1.api :as api]
1011 [neovim-client.1.api.buffer :as api.buffer]
231232 (log/info (:val res))
232233 (.close res-chan))))))))
233234
235+ (nvim/register-method!
236+ nvim
237+ " eval-buffer-ns"
238+ (run-command
239+ plugin
240+ (fn [msg]
241+ (let [buffer-name (api/get-current-buf nvim)
242+ file-name (api.buffer/get-name nvim buffer-name)
243+ file (io/file file-name)
244+ namespace-declarations (namespace.find/find-ns-decls-in-dir file)]
245+ (async/>!! (socket-repl/input-channel socket-repl) (first namespace-declarations))))))
246+
234247 (nvim/register-method!
235248 nvim
236249 " show-log"
You can’t perform that action at this time.
0 commit comments