Skip to content

Commit

Permalink
fix: consider the border when calculating the width of the documentat…
Browse files Browse the repository at this point in the history
…ion window
  • Loading branch information
ofseed committed Nov 13, 2024
1 parent b2c955e commit f31eb8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/blink/cmp/windows/lib/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -293,18 +293,18 @@ function win:get_direction_with_window_constraints(anchor_win, direction_priorit
},
s = {
vertical = anchor_is_above_cursor and cursor_constraints.distance_from_bottom
or (screen_height - (anchor_height + anchor_row - 1)),
or (screen_height - (anchor_height + anchor_row - 1 + anchor_border_size.horizontal)),
horizontal = screen_width - (anchor_col - 1),
},
e = {
vertical = anchor_is_above_cursor and cursor_constraints.distance_from_top
or cursor_constraints.distance_from_bottom,
horizontal = screen_width - (anchor_col - 1) - anchor_width,
horizontal = screen_width - (anchor_col - 1) - anchor_width - anchor_border_size.right,
},
w = {
vertical = anchor_is_above_cursor and cursor_constraints.distance_from_top
or cursor_constraints.distance_from_bottom,
horizontal = anchor_col - 1,
horizontal = anchor_col - 1 + anchor_border_size.left,
},
}

Expand Down

0 comments on commit f31eb8f

Please sign in to comment.