Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot override options when replace layout is used #356

Open
kjuq opened this issue Jun 6, 2024 · 0 comments
Open

Cannot override options when replace layout is used #356

kjuq opened this issue Jun 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kjuq
Copy link

kjuq commented Jun 6, 2024

It is impossible to overwrite the window-scoped options set by these lines when using replace layout, even by configuring according to the document (https://github.com/CopilotC-Nvim/CopilotChat.nvim?tab=readme-ov-file#customizing-buffers).

vim.wo[self.winnr].wrap = true
vim.wo[self.winnr].linebreak = true
vim.wo[self.winnr].cursorline = true
vim.wo[self.winnr].conceallevel = 2
vim.wo[self.winnr].foldlevel = 99
if config.show_folds then
vim.wo[self.winnr].foldcolumn = '1'
vim.wo[self.winnr].foldmethod = 'expr'
vim.wo[self.winnr].foldexpr = "v:lua.CopilotChatFoldExpr(v:lnum, '" .. config.separator .. "')"
else
vim.wo[self.winnr].foldcolumn = '0'

How to reproduce

mkdir --parents /tmp/nvim/plugins
git clone https://github.com/CopilotC-Nvim/CopilotChat.nvim /tmp/nvim/plugins/CopilotChat.nvim
git clone https://github.com/zbirenbaum/copilot.lua /tmp/nvim/plugins/copilot.lua
git clone https://github.com/nvim-lua/plenary.nvim /tmp/nvim/plugins/plenary.nvim
echo 'vim.opt.rtp:append("/tmp/nvim/plugins/CopilotChat.nvim")
vim.opt.rtp:append("/tmp/nvim/plugins/copilot.lua")
vim.opt.rtp:append("/tmp/nvim/plugins/plenary.nvim")

require("CopilotChat").setup({ window = { layout = "replace" } })

vim.api.nvim_create_autocmd("BufEnter", {
	pattern = "copilot-*",
	callback = function()
		vim.opt_local.cursorline = false
	end,
})' > /tmp/nvim/init.lua

nvim -u /tmp/nvim/init.lua
:CopilotChat

Cursorline is shown.

@deathbeam deathbeam added the bug Something isn't working label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants