diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index c06865d7..3c2a73da 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -162,27 +162,27 @@ return { Separator = "FzfColorsBorder", } for name, link in pairs(links) do - name = "FzfColors" .. name + name = "FzfLuaColors" .. name vim.api.nvim_set_hl(0, name, { link = link, default = true }) end opts.fzf_colors = { - ["fg"] = { "fg", "FzfColorsNormal" }, - ["bg"] = { "bg", "FzfColorsNormal" }, - ["hl"] = { "fg", "FzfColorsMatch" }, - ["fg+"] = { "fg", "FzfColorsCursorLine" }, - ["bg+"] = { "bg", "FzfColorsCursorLine" }, - ["hl+"] = { "fg", "FzfColorsMatch" }, - ["info"] = { "fg", "FzfColorsInfo" }, - ["border"] = { "fg", "FzfColorsBorder" }, - ["separator"] = { "fg", "FzfColorsSeparator" }, - ["scrollbar"] = { "fg", "FzfColorsScrollbar" }, - ["gutter"] = { "bg", "FzfColorsGutter" }, - ["query"] = { "fg", "FzfColorsQuery", "regular" }, - ["prompt"] = { "fg", "FzfColorsPrompt" }, - ["pointer"] = { "fg", "FzfColorsPointer" }, - ["marker"] = { "fg", "FzfColorsMarker" }, - ["spinner"] = { "fg", "FzfColorsSpinner" }, - ["header"] = { "fg", "FzfColorsHeader" }, + ["fg"] = { "fg", "FzfLuaColorsNormal" }, + ["bg"] = { "bg", "FzfLuaColorsNormal" }, + ["hl"] = { "fg", "FzfLuaColorsMatch" }, + ["fg+"] = { "fg", "FzfLuaColorsCursorLine" }, + ["bg+"] = { "bg", "FzfLuaColorsCursorLine" }, + ["hl+"] = { "fg", "FzfLuaColorsMatch" }, + ["info"] = { "fg", "FzfLuaColorsInfo" }, + ["border"] = { "fg", "FzfLuaColorsBorder" }, + ["separator"] = { "fg", "FzfLuaColorsSeparator" }, + ["scrollbar"] = { "fg", "FzfLuaColorsScrollbar" }, + ["gutter"] = { "bg", "FzfLuaColorsGutter" }, + ["query"] = { "fg", "FzfLuaColorsQuery", "regular" }, + ["prompt"] = { "fg", "FzfLuaColorsPrompt" }, + ["pointer"] = { "fg", "FzfLuaColorsPointer" }, + ["marker"] = { "fg", "FzfLuaColorsMarker" }, + ["spinner"] = { "fg", "FzfLuaColorsSpinner" }, + ["header"] = { "fg", "FzfLuaColorsHeader" }, } end, }, diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua index ec64987f..30160215 100644 --- a/lua/lazyvim/util/pick.lua +++ b/lua/lazyvim/util/pick.lua @@ -9,6 +9,7 @@ local M = setmetatable({}, { ---@class lazyvim.util.pick.Opts: table ---@field root? boolean ---@field cwd? string +---@field buf? number ---@field show_untracked? boolean ---@type table @@ -30,7 +31,7 @@ function M.open(command, opts) end if not opts.cwd and opts.root ~= false then - opts.cwd = LazyVim.root() + opts.cwd = LazyVim.root({ buf = opts.buf }) end local cwd = opts.cwd or vim.uv.cwd() diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index 4523f3cf..a401ccf4 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -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