Skip to content

Commit

Permalink
patch 9.1.0488: Wrong padding for pum "kind" with 'rightleft'
Browse files Browse the repository at this point in the history
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: #15004

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
  • Loading branch information
zeertzjq authored and chrisbra committed Jun 15, 2024
1 parent ae321b5 commit a232437
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/popupmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ pum_redraw(void)
{
screen_fill(row, row + 1, pum_col - pum_base_width - n + 1,
col + 1, ' ', ' ', attr);
col = pum_col - pum_base_width - n + 1;
col = pum_col - pum_base_width - n;
}
else
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/testdir/dumps/Test_pum_highlights_06.dump
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
| +0&#ffffff0@70|o>f|o|f
| +0#4040ff13&@58| +0#0000001#e0e0e08@1|d|n|i|k|o@1|f| @3|o|o+0#00e0e07#ffd7ff255|f
| +0#4040ff13#ffffff0@58| +0#0000001#ffd7ff255@1|d|n|i|k|o@1|f| |r|a|b|o|o+0#0000e05&|f
| +0#4040ff13#ffffff0@58| +0#0000001#ffd7ff255@1|d|n|i|k|o@1|f| |z|a|B|o|o+0#0000e05&|f
| +0#4040ff13#ffffff0@58| +0#0000001#ffd7ff255@1|d|n|i|k|o@1|f|a|l|a|b|o|o+0#0000e05&|f
| +0#4040ff13&@58| +0#0000001#e0e0e08|d|n|i|k|o@1|f| @4|o|o+0#00e0e07#ffd7ff255|f
| +0#4040ff13#ffffff0@58| +0#0000001#ffd7ff255|d|n|i|k|o@1|f| @1|r|a|b|o|o+0#0000e05&|f
| +0#4040ff13#ffffff0@58| +0#0000001#ffd7ff255|d|n|i|k|o@1|f| @1|z|a|B|o|o+0#0000e05&|f
| +0#4040ff13#ffffff0@58| +0#0000001#ffd7ff255|d|n|i|k|o@1|f| |a|l|a|b|o|o+0#0000e05&|f
| +0#4040ff13#ffffff0@73|~
| @73|~
| @73|~
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
488,
/**/
487,
/**/
Expand Down

0 comments on commit a232437

Please sign in to comment.