ivy.nvim/plugin/ivy.lua
Ade Attwood c1ede21dd8
Some checks failed
CI / Luacheck (pull_request) Successful in 20s
CI / StyLua (pull_request) Failing after 4s
CI / Cargo Format (pull_request) Successful in 19s
CI / Build and test (pull_request) Successful in 1m55s
Conventional Tools Commitlint / Commitlint (pull_request) Successful in 5s
chore: make public api consistent
Summary:

Right now we have two ways to access the public api we have `require('ivy')`
and `vim.ivy. Each way has a different api that will cause some confusion.

Now both apis are the same so anyone that wants to integrate with ivy can do so
without having to figure out what one they need to use.

Test Plan:

The unit tests cover most of the work, I have also been using this locally for
quite some time now with now issues.
2024-09-03 06:47:04 +00:00

19 lines
522 B
Lua

local api = require "ivy"
-- Put the controller in to the vim global so we can access it in mappings
-- better without requires. You can call controller commands like `vim.ivy.xxx`.
-- luacheck: ignore
vim.ivy = api
vim.paste = (function(overridden)
return function(lines, phase)
local file_type = vim.api.nvim_buf_get_option(0, "filetype")
if file_type == "ivy" then
vim.ivy.paste()
else
overridden(lines, phase)
end
end
end)(vim.paste)
vim.cmd "highlight IvyMatch cterm=bold gui=bold"