fix(pum): adjust info window column offset when scrollbar is present (#37069)

Problem:
When the popupmenu has no border but includes a scrollbar, the info window
column is misaligned due to a missing column offset.

Solution:
Apply a one-column offset to the info window when the popup menu has no border
and a scrollbar is present.
This commit is contained in:
glepnir
2025-12-26 10:15:55 +08:00
committed by GitHub
parent b7adf8081c
commit ef0386fe9a
2 changed files with 11 additions and 4 deletions

View File

@@ -959,10 +959,7 @@ static void pum_preview_set_text(buf_T *buf, char *info, linenr_T *lnum, int *ma
static void pum_adjust_info_position(win_T *wp, int width)
{
int border_width = pum_border_width();
int col = pum_col + pum_width + 1 + border_width;
if (border_width < 0) {
col += pum_scrollbar;
}
int col = pum_col + pum_width + 1 + MAX(border_width, pum_scrollbar);
// TODO(glepnir): support config align border by using completepopup
// align menu
int right_extra = Columns - col;