Skip to content

Commit 75cadbc

Browse files
committed
feat: only offset window when using preset draw
1 parent 0b4bbe7 commit 75cadbc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/blink/cmp/windows/autocomplete.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,11 @@ function autocomplete.update_position(context)
204204
local cursor_col = vim.api.nvim_win_get_cursor(0)[2]
205205
local col = context.bounds.start_col - cursor_col - (context.bounds.length == 0 and 0 or 1)
206206
local row = pos.direction == 's' and 1 or -pos.height - border_size.vertical
207-
vim.api.nvim_win_set_config(winnr, { relative = 'cursor', row = row, col = col - 1 })
207+
vim.api.nvim_win_set_config(winnr, {
208+
relative = 'cursor',
209+
row = row,
210+
col = col - (vim.tbl_contains({ 'minimal', 'reversed' }, autocmp_config.draw) and 1 or 0),
211+
})
208212
vim.api.nvim_win_set_height(winnr, pos.height)
209213

210214
for _, callback in ipairs(autocomplete.event_targets.on_position_update) do

0 commit comments

Comments
 (0)