From 75cadbcd2657ed01326ca2b0e5e4d78a77127ca3 Mon Sep 17 00:00:00 2001 From: Liam Dyer Date: Sat, 2 Nov 2024 20:00:02 -0400 Subject: [PATCH] feat: only offset window when using preset draw --- lua/blink/cmp/windows/autocomplete.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/blink/cmp/windows/autocomplete.lua b/lua/blink/cmp/windows/autocomplete.lua index 92c0fa98..3edd28d6 100644 --- a/lua/blink/cmp/windows/autocomplete.lua +++ b/lua/blink/cmp/windows/autocomplete.lua @@ -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