// redo the positioning. Limit this to two times, when there is not
// much room the window size will keep changing.
} while (pum_set_selected(selected, redo_count) && ++redo_count <= 2);
+
+ pum_redraw();
}
/*
{
if (st != NULL)
{
- screen_puts_len(st, (int)STRLEN(st), row, col,
- attr);
+ int size = (int)STRLEN(st);
+ int cells = (*mb_string2cells)(st, size);
+
+ // only draw the text that fits
+ while (size > 0
+ && col + cells > pum_width + pum_col)
+ {
+ --size;
+ if (has_mbyte)
+ {
+ size -= (*mb_head_off)(st, st + size);
+ cells -= (*mb_ptr2cells)(st + size);
+ }
+ else
+ --cells;
+ }
+ screen_puts_len(st, size, row, col, attr);
vim_free(st);
}
col += width;
popup_hide_info();
#endif
- if (!resized)
- pum_redraw();
-
return resized;
}