refactor: temp code for better fzf_colors

This commit is contained in:
Folke Lemaitre 2024-06-10 17:10:25 +02:00
parent 26254487fb
commit 6a07e6522a
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
3 changed files with 24 additions and 22 deletions

View file

@ -168,13 +168,14 @@ end
-- * lsp root_dir
-- * root pattern of filename of the current buffer
-- * root pattern of cwd
---@param opts? {normalize?:boolean}
---@param opts? {normalize?:boolean, buf?:number}
---@return string
function M.get(opts)
local buf = vim.api.nvim_get_current_buf()
opts = opts or {}
local buf = opts.buf or vim.api.nvim_get_current_buf()
local ret = M.cache[buf]
if not ret then
local roots = M.detect({ all = false })
local roots = M.detect({ all = false, buf = buf })
ret = roots[1] and roots[1].paths[1] or vim.uv.cwd()
M.cache[buf] = ret
end