Skip to content

Commit 0fe1aaa

Browse files
authored
feat: support horizontal and vertical splits (zbirenbaum#289)
1 parent 7593549 commit 0fe1aaa

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ require('copilot').setup({
5757
open = "<M-CR>"
5858
},
5959
layout = {
60-
position = "bottom", -- | top | left | right
60+
position = "bottom", -- | top | left | right | horizontal | vertical
6161
ratio = 0.4
6262
},
6363
},

lua/copilot/panel.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ function panel:ensure_winid()
331331
right = { cmd_prefix = "vertical botright ", winsize_fn = get_width },
332332
bottom = { cmd_prefix = "botright ", winsize_fn = get_height },
333333
left = { cmd_prefix = "vertical topleft ", winsize_fn = get_width },
334+
horizontal = { cmd_prefix = "horizontal ", winsize_fn = get_height },
335+
vertical = { cmd_prefix = "vertical ", winsize_fn = get_width },
334336
}
335337

336338
local split_info = split_map[position]
@@ -541,7 +543,7 @@ function mod.refresh()
541543
end
542544

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

0 commit comments

Comments
 (0)