Skip to content

Commit 130eb51

Browse files
authored
fix: consider the border when calculating the width of the documentat… (#326)
1 parent 1309ec5 commit 130eb51

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/blink/cmp/windows/lib/init.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -293,18 +293,18 @@ function win:get_direction_with_window_constraints(anchor_win, direction_priorit
293293
},
294294
s = {
295295
vertical = anchor_is_above_cursor and cursor_constraints.distance_from_bottom
296-
or (screen_height - (anchor_height + anchor_row - 1)),
296+
or (screen_height - (anchor_height + anchor_row - 1 + anchor_border_size.vertical)),
297297
horizontal = screen_width - (anchor_col - 1),
298298
},
299299
e = {
300300
vertical = anchor_is_above_cursor and cursor_constraints.distance_from_top
301301
or cursor_constraints.distance_from_bottom,
302-
horizontal = screen_width - (anchor_col - 1) - anchor_width,
302+
horizontal = screen_width - (anchor_col - 1) - anchor_width - anchor_border_size.right,
303303
},
304304
w = {
305305
vertical = anchor_is_above_cursor and cursor_constraints.distance_from_top
306306
or cursor_constraints.distance_from_bottom,
307-
horizontal = anchor_col - 1,
307+
horizontal = anchor_col - 1 + anchor_border_size.left,
308308
},
309309
}
310310

0 commit comments

Comments
 (0)