Skip to content

Commit

Permalink
Remove the weird omnifunc function string mapping, use a lua reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Olical committed Feb 15, 2025
1 parent 2ff8013 commit 0b8dd18
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
11 changes: 4 additions & 7 deletions fnl/conjure/mapping.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@
(when (= :function (type (client.get :completions)))
(let [fn-name (config.get-in [:completion :omnifunc])]
(when fn-name
(vim.api.nvim_command (.. "setlocal omnifunc=" fn-name)))))
(set _G._conjure_omnifunc
(fn [find-start base]
(M.omnifunc (= find-start 1) base)))
(set vim.bo.omnifunc "v:lua._conjure_omnifunc"))))

(client.optional-call :on-filetype))

Expand Down Expand Up @@ -302,12 +305,6 @@
"\\k\\+$"))))
(eval.completions-sync base)))

(vim.api.nvim_command
(->> ["function! ConjureOmnifunc(findstart, base)"
"return luaeval(\"require('conjure.mapping')['omnifunc'](_A[1] == 1, _A[2])\", [a:findstart, a:base])"
"endfunction"]
(str.join "\n")))

(vim.api.nvim_create_user_command
"ConjureEval"
#(M.eval-ranged-command (. $ :line1) (. $ :line2) (. $ :args))
Expand Down
49 changes: 26 additions & 23 deletions lua/conjure/mapping.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0b8dd18

Please sign in to comment.