Skip to content

Commit 746dfd1

Browse files
committed
Make completion context builder return nil on not found
1 parent a840aff commit 746dfd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/socket_repl/socket_repl_plugin.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
(= [0 0] ctx-end))
9393
(do
9494
(log/info "Ctx not found")
95-
"")
95+
nil)
9696
(let [buffer (api/get-current-buf nvim)
9797
lines (into [] (api.buffer-ext/get-lines nvim buffer (dec ctx-start-line) (inc ctx-end-line)))
9898
line-delta (max 0 (- cursor-line ctx-start-line))]
@@ -300,7 +300,7 @@
300300
code-form (str "(srepl.injection/completions "
301301
"\"" word "\" "
302302
"{:ns *ns* "
303-
":context " context
303+
(when context (str ":context " context))
304304
":extra-metadata #{:arglists :doc}"
305305
"})")
306306
res-chan (async/chan 1 (filter #(= (:form %)

0 commit comments

Comments
 (0)