Skip to content

Commit 41178d3

Browse files
authored
fix: consider the border when calculating the position of the autocom… (#325)
1 parent 5479abf commit 41178d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/blink/cmp/windows/autocomplete.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function autocomplete.update_position(context)
176176
-- place the window at the start col of the current text we're fuzzy matching against
177177
-- so the window doesnt move around as we type
178178
local cursor_col = vim.api.nvim_win_get_cursor(0)[2]
179-
local col = context.bounds.start_col - cursor_col - (context.bounds.length == 0 and 0 or 1)
179+
local col = context.bounds.start_col - cursor_col - (context.bounds.length == 0 and 0 or 1) - border_size.left
180180
local row = pos.direction == 's' and 1 or -pos.height - border_size.vertical
181181
vim.api.nvim_win_set_config(winnr, { relative = 'cursor', row = row, col = col - start_col })
182182
vim.api.nvim_win_set_height(winnr, pos.height)

0 commit comments

Comments
 (0)