Skip to content

Commit 4e9d7ca

Browse files
committed
fix: autocomplete window placement
1 parent 3b7fe1d commit 4e9d7ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/blink/cmp/windows/autocomplete.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ function autocomplete.update_position(context)
104104
local col = context.bounds.start_col - cursor_col - 1
105105

106106
-- detect if there's space above/below the cursor
107-
local is_space_below = screen_height - cursor_row - screen_scroll_range.start_line > height
107+
-- todo: should pick the largest space if both are false and limit height of the window
108+
local is_space_below = screen_height - (cursor_row - screen_scroll_range.start_line) >= height
108109
local is_space_above = cursor_row - screen_scroll_range.start_line > height
109110

110111
-- default to the user's preference but attempt to use the other options

0 commit comments

Comments
 (0)