Closed Konfekt closed 4 weeks ago
Firstly, I don't understand why you're not using the minimal.lua
file that comes with the bug report or respecting the template.
Secondly, I cannot recreate your issue:
This was my minimal file:
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- Copilot adapter override
vim.env["CODECOMPANION_TOKEN_PATH"] = vim.fn.expand("~/.config")
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- Your CodeCompanion setup
local plugins = {
{ "junegunn/fzf" },
{
"olimorris/codecompanion.nvim",
dependencies = {
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
"nvim-lua/plenary.nvim",
"hrsh7th/nvim-cmp",
"nvim-telescope/telescope.nvim",
{
"stevearc/dressing.nvim",
opts = {},
},
},
opts = {
-- Refer to: https://github.com/olimorris/codecompanion.nvim/blob/main/lua/codecompanion/config.lua
strategies = { -- Change the adapters as required
chat = { adapter = "copilot" },
inline = { adapter = "copilot" },
agent = { adapter = "copilot" },
},
opts = {
log_level = "DEBUG",
},
},
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
-- setup Tree-sitter
local ok, treesitter = pcall(require, "nvim-treesitter.configs")
if ok then
treesitter.setup({
ensure_installed = { "lua", "markdown", "markdown_inline", "yaml" },
highlight = { enable = true },
})
end
-- Setup completion
local ok, cmp = pcall(require, "cmp")
if ok then
cmp.setup({
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
})
end
I thought mininal.lua to be minimal (and tried to keep my setup minimal). Could you try mine without the optional telescope dependency contained in yours?
It works fine if either fzf.vim is not there or telescope supplants it.
So one could for example check for :FZF
and try to ignore the FZF adaptions.
Please try again with the minimal setup I shared. Run nvim --clean -u minimal.lua
to launch Neovim. I can't recreate this issue.
Removing Telescope:
Removing Telescope and Dressing.nvim:
Remove telescope, but not "stevearc/dressing.nvim".
I am using
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- Your CodeCompanion setup
local plugins = {
{ "junegunn/fzf" },
{
"olimorris/codecompanion.nvim",
dependencies = {
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
"nvim-lua/plenary.nvim",
"hrsh7th/nvim-cmp",
{
"stevearc/dressing.nvim",
opts = {},
},
},
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
I can't recreate this with your minimal.lua file:
I think the issue is on your end and with your config.
Thank you, indeed. $FZF_DEFAULT_OPTS
contained --keep-right
. How about ignoring this option for more reproducible behavior?
$FZF_DEFAULT_OPTS
is an FZF option. CodeCompanion has no support for junegunn/fzf.
This is a dressing.nvim issue?
Enlargening the actions window (shown in your above screencast) could also help.
FZF...surely?
I wonder how FZF interferes if Codecompanion does not use it.
Another issue: Can you verify that selecting option 4, workflows, the focus of the popup window is lost?
Your
minimal.lua
configlocal root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro for , name in ipairs({ "config", "data", "state", "cache" }) do vim.env[("XDG%s_HOME"):format(name:upper())] = root .. "/" .. name end
-- bootstrap lazy local lazypath = root .. "/plugins/lazy.nvim" if not vim.loop.fs_stat(lazypath) then vim.fn.system({ "git", "clone", "--filter=blob:none", "--single-branch", "https://github.com/folke/lazy.nvim.git", lazypath, }) end vim.opt.runtimepath:prepend(lazypath)
-- Your CodeCompanion setup local plugins = { {"junegunn/fzf"}, { "olimorris/codecompanion.nvim", dependencies = { { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate"}, "nvim-lua/plenary.nvim", "hrsh7th/nvim-cmp", { "stevearc/dressing.nvim", opts = {}, }, }, } }
require("lazy").setup(plugins, { root = root .. "/plugins", })
Error messages
.
Log output
.
Health check output
No response
Describe the bug
This follows up on https://github.com/olimorris/codecompanion.nvim/issues/213
If FZF is installed, then the FZF window that opens after entering
:CodeCompanionActions<cr>
is unreadably even with fullscreen vim.If https://github.com/ibhagwan/fzf-lua is installed, then it becomes readable in fullscreen, but still unreadable
if, say, the columwidth is, say, below 100 as shown below
Instead, ensure that the first column is always show and rather shorten the rightmost.
So the first step would be to add https://github.com/ibhagwan/fzf-lua as a dependency (which can optionally be replaced by telescope), and then ensure that at least the leftmost columns stays readable.
Reproduce the bug
Run
Enter
:CodeCompanionActions<cr>
.Final checks
minimal.lua
file from above and have shared this