Skip to content

Commit 07988b9

Browse files
committed
feat: add CopilotChatToggleLayout
chore: fix lint
1 parent 2dbf250 commit 07988b9

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lua/CopilotChat/init.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ M.setup = function(options)
2323
vim.cmd('CopilotChat ' .. value)
2424
end, { nargs = '*', range = true })
2525
end
26+
27+
-- Toggle between newbuffer and split
28+
utils.create_cmd('CopilotChatToggleLayout', function()
29+
if vim.g.copilot_chat_view_option == 'newbuffer' then
30+
vim.g.copilot_chat_view_option = 'split'
31+
else
32+
vim.g.copilot_chat_view_option = 'newbuffer'
33+
end
34+
end, { nargs = '*', range = true })
2635
end
2736

2837
return M

0 commit comments

Comments
 (0)