ivy.nvim/lua/ivy/libivy.lua
Ade Attwood d60ba5085a fix: include dot files in search results
This adds dot files into the finder. We are adding the overrides to the
`ignore` package, that can be used later to add custom ignore
directories that can be passed in as settings.

We are also adding a new `ivy_cwd` function to libivy to get the current
directory due to the limitations of lua.

Fixes-issue: #16
2022-09-04 13:29:47 +01:00

34 lines
761 B
Lua

local library_path = (function()
local dirname = string.sub(debug.getinfo(1).source, 2, #"/fzf_lib.lua" * -1)
return dirname .. "/../../target/release/libivyrs.so"
end)()
local ffi = require "ffi"
local ivy_c = ffi.load(library_path)
ffi.cdef [[
void ivy_init(const char*);
char* ivy_cwd();
int ivy_match(const char*, const char*);
char* ivy_files(const char*, const char*);
]]
local libivy = {}
libivy.ivy_init = function(dir)
ivy_c.ivy_init(dir)
end
libivy.ivy_cwd = function ()
return ffi.string(ivy_c.ivy_cwd())
end
libivy.ivy_match = function(pattern, text)
return ivy_c.ivy_match(pattern, text)
end
libivy.ivy_files = function(pattern, base_dir)
return ffi.string(ivy_c.ivy_files(pattern, base_dir))
end
return libivy