From 816806c6385ceb4d58aad0e158d273be18d51e88 Mon Sep 17 00:00:00 2001 From: Oli Morris Date: Tue, 19 Mar 2024 08:41:02 +0000 Subject: [PATCH] fix: #26 bisect win opts by bufnr --- lua/codecompanion/strategies/chat.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/codecompanion/strategies/chat.lua b/lua/codecompanion/strategies/chat.lua index f4ec4037..0a549d3e 100644 --- a/lua/codecompanion/strategies/chat.lua +++ b/lua/codecompanion/strategies/chat.lua @@ -274,7 +274,7 @@ local function chat_autocmds(bufnr) group = aug, buffer = bufnr, callback = function() - ui.set_win_options(api.nvim_get_current_win(), _G.codecompanion_win_opts) + ui.set_win_options(api.nvim_get_current_win(), _G.codecompanion_win_opts[bufnr]) end, }) @@ -416,7 +416,7 @@ function Chat.new(args) api.nvim_set_current_buf(bufnr) end - _G.codecompanion_win_opts = ui.get_win_options(winid, config.options.display.chat.win_options) + _G.codecompanion_win_opts[bufnr] = ui.get_win_options(winid, config.options.display.chat.win_options) ui.set_win_options(winid, config.options.display.chat.win_options) vim.cmd("setlocal formatoptions-=t") ui.buf_scroll_to_end(bufnr)