vim-patch:9.1.0488: Wrong padding for pum "kind" with 'rightleft' (#29352)

Problem:  Wrong padding for pum "kind" with 'rightleft'.
Solution: Fix off-by-one error (zeertzjq).

The screen_fill() above is end-exclusive, and
- With 'rightleft' it fills `pum_col - pum_base_width - n + 1` to `col`,
  so the next `col` should be `pum_col - pum_base_width - n`.
- With 'norightleft' it fills `col` to `pum_col - pum_base_width + n - 1`,
  so the next `col` should be `pum_col - pum_base_width + n`.

closes: vim/vim#15004

a2324373eb
This commit is contained in:
zeertzjq
2024-06-15 21:39:56 +08:00
committed by GitHub
parent bb487ea12e
commit fd2ef4edf9
2 changed files with 9 additions and 9 deletions

View File

@@ -713,7 +713,7 @@ void pum_redraw(void)
if (pum_rl) { if (pum_rl) {
grid_line_fill(col_off - pum_base_width - n + 1, grid_col + 1, schar_from_ascii(' '), attr); grid_line_fill(col_off - pum_base_width - n + 1, grid_col + 1, schar_from_ascii(' '), attr);
grid_col = col_off - pum_base_width - n + 1; grid_col = col_off - pum_base_width - n;
} else { } else {
grid_line_fill(grid_col, col_off + pum_base_width + n, schar_from_ascii(' '), attr); grid_line_fill(grid_col, col_off + pum_base_width + n, schar_from_ascii(' '), attr);
grid_col = col_off + pum_base_width + n; grid_col = col_off + pum_base_width + n;