Skip to content

Commit

Permalink
fix: pick documentation direction via desired min width only
Browse files Browse the repository at this point in the history
Closes #1181
  • Loading branch information
Saghen committed Feb 20, 2025
1 parent 3d38eb4 commit 2fb514b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lua/blink/cmp/completion/windows/documentation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,9 @@ function docs.update_position()
end

-- decide direction, width and height of window
local win_width = docs.win:get_width()
local win_height = docs.win:get_height()
local pos = docs.win:get_direction_with_window_constraints(menu.win, direction_priority, {
width = math.min(win_width, win_config.desired_min_width),
height = math.min(win_height, win_config.desired_min_height),
width = win_config.desired_min_width,
height = win_config.desired_min_height,
})

-- couldn't find anywhere to place the window
Expand Down

0 comments on commit 2fb514b

Please sign in to comment.