···39394040local is_ignored_cache = {}
41414242+-- TODO(algmyr): Consider removing this at some point.
4343+--- Absolute path, to support versions <0.11 (for now).
4444+---@param path string
4545+local function _abspath(path)
4646+ if vim.fs.abspath then
4747+ return vim.fs.abspath(path)
4848+ else
4949+ return vim.fn.fnamemodify(path, ":p")
5050+ end
5151+end
5252+4253-- Check if file should be ignored as per gitignore rules.
4354function M.is_ignored(path)
4455 if is_ignored_cache[path] ~= nil then
4556 return is_ignored_cache[path]
4657 end
47584848- local absolute_path = vim.fs.normalize(vim.fs.abspath(path))
5959+ local absolute_path = vim.fs.normalize(_abspath(path))
49605061 local vcs_root = _get_vcs_root(vim.fs.dirname(absolute_path))
5162 if vcs_root then