Skip to content

Commit

Permalink
feat: only offset window when using preset draw
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Nov 3, 2024
1 parent 0b4bbe7 commit 75cadbc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/blink/cmp/windows/autocomplete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ function autocomplete.update_position(context)
local cursor_col = vim.api.nvim_win_get_cursor(0)[2]
local col = context.bounds.start_col - cursor_col - (context.bounds.length == 0 and 0 or 1)
local row = pos.direction == 's' and 1 or -pos.height - border_size.vertical
vim.api.nvim_win_set_config(winnr, { relative = 'cursor', row = row, col = col - 1 })
vim.api.nvim_win_set_config(winnr, {
relative = 'cursor',
row = row,
col = col - (vim.tbl_contains({ 'minimal', 'reversed' }, autocmp_config.draw) and 1 or 0),
})
vim.api.nvim_win_set_height(winnr, pos.height)

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

0 comments on commit 75cadbc

Please sign in to comment.