aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/popupmenu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c
index b1c6e02449..d26651fb84 100644
--- a/src/nvim/popupmenu.c
+++ b/src/nvim/popupmenu.c
@@ -686,13 +686,13 @@ void pum_redraw(void)
char *rt_start = rt;
int cells = vim_strsize(rt);
- if (cells > pum_width) {
+ if (grid_col - cells < col_off - pum_width) {
do {
cells -= utf_ptr2cells(rt);
MB_PTR_ADV(rt);
- } while (cells > pum_width);
+ } while (grid_col - cells < col_off - pum_width);
- if (cells < pum_width) {
+ if (grid_col - cells > col_off - pum_width) {
// Most left character requires 2-cells but only 1 cell is available on
// screen. Put a '<' on the left of the pum item.
*(--rt) = '<';