Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ require('copilot').setup({
open = "<M-CR>"
},
layout = {
position = "bottom", -- | top | left | right
position = "bottom", -- | top | left | right | horizontal | vertical
ratio = 0.4
},
},
Expand Down
4 changes: 3 additions & 1 deletion lua/copilot/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ function panel:ensure_winid()
right = { cmd_prefix = "vertical botright ", winsize_fn = get_width },
bottom = { cmd_prefix = "botright ", winsize_fn = get_height },
left = { cmd_prefix = "vertical topleft ", winsize_fn = get_width },
horizontal = { cmd_prefix = "horizontal ", winsize_fn = get_height },
vertical = { cmd_prefix = "vertical ", winsize_fn = get_width },
}

local split_info = split_map[position]
Expand Down Expand Up @@ -539,7 +541,7 @@ function mod.refresh()
end

---@param layout {position: string, ratio: number}
---position: (optional) 'bottom' | 'top' | 'left' | 'right'
---position: (optional) 'bottom' | 'top' | 'left' | 'right' | 'horizontal' | 'vertical'
---ratio: (optional) between 0 and 1
function mod.open(layout)
local client = c.get()
Expand Down