Skip to content

Commit 8beed10

Browse files
committed
Add function to get current word
1 parent 06b5120 commit 8beed10

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/neovim_client/nvim.clj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,23 @@
2020
[cmd-str f]
2121
(rpc/send-message-async! (->request-msg "vim_command" [cmd-str]) f))
2222

23+
(defn get-var-async
24+
[var-name f]
25+
(rpc/send-message-async! (->request-msg "vim_get_var" [var-name]) f))
26+
27+
(defn get-vvar-async
28+
[var-name f]
29+
(rpc/send-message-async! (->request-msg "vim_get_vvar" [var-name]) f))
30+
31+
(defn call-function-async
32+
[f-name args f]
33+
(rpc/send-message-async! (->request-msg "vim_call_function" [f-name args]) f))
34+
2335
(defn get-api-info [] (send-message! "vim_get_api_info"))
2436

37+
(defn get-api-info-async [f]
38+
(rpc/send-message-async! (->request-msg "vim_get_api_info" []) f))
39+
2540
;; ***** Cursor *****
2641

2742
(declare get-current-window-async)
@@ -128,5 +143,10 @@
128143
(defn hsplit! [] (run-command! "new"))
129144
(defn vsplit! [] (run-command! "vnew"))
130145

146+
(defn get-current-word-async
147+
"Get the current word asynchronously."
148+
[f]
149+
(call-function-async "expand" ["<cword>"] f))
150+
131151
;; TODO
132152
;; the rest of the functions in (get_api_info)

0 commit comments

Comments
 (0)