From fd2ef4edf9cc1461edaf9f7ce34711d9b40a7fb8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 15 Jun 2024 21:39:56 +0800 Subject: 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 https://github.com/vim/vim/commit/a2324373eb1c3f1777bc40cb6dcd5e895a15fe10 --- src/nvim/popupmenu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c index 1ef5aac1e9..b8e7630802 100644 --- a/src/nvim/popupmenu.c +++ b/src/nvim/popupmenu.c @@ -713,7 +713,7 @@ void pum_redraw(void) if (pum_rl) { 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 { grid_line_fill(grid_col, col_off + pum_base_width + n, schar_from_ascii(' '), attr); grid_col = col_off + pum_base_width + n; -- cgit