File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1- (defproject neovim-client " 0.1.1 "
1+ (defproject neovim-client " 0.1.2 "
22 :description " Client library for the Neovim RPC API"
33 :url " https://github.com/clojure-vim/neovim-client"
44 :license {:name " Eclipse Public License"
Original file line number Diff line number Diff line change 2020 (string/join " \n " (api.buffer-ext/get-lines
2121 nvim (api/get-current-buf nvim) 0 -1 )))
2222
23+ (defn get-current-buffer-text-async
24+ " Convenience function to get the current buffer's text asynchronously."
25+ [nvim f]
26+ (api/get-current-buf-async
27+ nvim
28+ (fn [buf]
29+ (api.buffer-ext/get-lines-async
30+ nvim buf 0 -1
31+ (fn [lines] (f (string/join " \n " lines)))))))
32+
2333(defn get-current-word-async
2434 " Get the current word asynchronously."
2535 [nvim f]
3444 #(api.window/get-buf nvim %))
3545 (api/list-wins nvim))]
3646 ((set visible-buffers) buffer-name))))
47+
48+ (defn set-current-buffer-text
49+ " Sets the current buffer's contents."
50+ [nvim text]
51+ (api.buffer-ext/set-lines
52+ nvim (api/get-current-buf nvim) 0 -1 (string/split-lines text)))
Original file line number Diff line number Diff line change 2424 (is (thrown-with-msg?
2525 Throwable
2626 #"version not supported"
27- (client.nvim/new* 2 in out false )))))
27+ (client.nvim/new* Integer/MAX_VALUE in out false )))))
2828
2929 (with-neovim
3030 (let [{:keys [in out]} *neovim*]
You can’t perform that action at this time.
0 commit comments