int width,
int width_limit,
int totwidth,
- int next_isempty)
+ int next_isempty,
+ int selected)
{
- char_u *rt;
- int cells;
+ char_u *rt = NULL;
+ int cells = 0;
int over_cell = 0;
int truncated = FALSE;
int pad = next_isempty ? 0 : 2;
- int remaining;
+ int remaining = 0;
+ int trunc_attr = highlight_attr[selected ? HLF_PSI : HLF_PNI];
int truncrl = curwin->w_fill_chars.truncrl != NUL
? curwin->w_fill_chars.truncrl : '<';
width = cells + over_cell + 1;
rt = orig_rt;
- screen_putchar(truncrl, row, col - width + 1 + TPL_LCOL(NULL), attr);
+ screen_putchar(truncrl, row,
+ col - width + 1 + TPL_LCOL(NULL), trunc_attr);
if (over_cell > 0)
screen_fill(row, row + 1, col - width + 2 + TPL_LCOL(NULL),
int width, // width already calculated in outer loop
int width_limit,
int totwidth,
- int next_isempty)
+ int next_isempty,
+ int selected)
{
- int size;
- int cells;
+ int size = 0;
+ int cells = 0;
char_u *st_end = NULL;
int over_cell = 0;
int pad = next_isempty ? 0 : 2;
- int truncated;
- int remaining;
+ int truncated = FALSE;
+ int remaining = 0;
+ int trunc_attr = highlight_attr[selected ? HLF_PSI : HLF_PNI];
int trunc = curwin->w_fill_chars.trunc != NUL
? curwin->w_fill_chars.trunc : '>';
screen_fill(row, row + 1, col + cells + TPL_LCOL(NULL),
col + cells + over_cell + TPL_LCOL(NULL), ' ', ' ', attr);
- screen_putchar(trunc, row, col + cells + over_cell + TPL_LCOL(NULL), attr);
+ screen_putchar(trunc, row,
+ col + cells + over_cell + TPL_LCOL(NULL), trunc_attr);
}
VIM_CLEAR(st);
char_u *p = pum_get_item(idx, item_type);
int width = 0; // item width
int w; // char width
+ int selected = idx == pum_selected;
for ( ; ; MB_PTR_ADV(p))
{
#ifdef FEAT_RIGHTLEFT
if (pum_rl)
col = pum_display_rtl_text(row, col, st, attr, attrs,
- width, pum_width, *totwidth_ptr, next_isempty);
+ width, pum_width, *totwidth_ptr, next_isempty, selected);
else
#endif
col = pum_display_ltr_text(row, col, st, attr, attrs,
- width, pum_width, *totwidth_ptr, next_isempty);
+ width, pum_width, *totwidth_ptr, next_isempty, selected);
if (attrs != NULL)
VIM_CLEAR(attrs);
CheckScreendump
let lines =<< trim END
+ hi StrikeFake ctermfg=9
let g:change = 0
func Omni_test(findstart, base)
if a:findstart
\ #{word: "bar", menu: "fooMenu", kind: "一二三四"},
\ #{word: "一二三四五", kind: "multi"},
\ ]
- else
return [#{word: "bar", menu: "fooMenu", kind: "一二三"}]
+ elseif g:change == 3
+ return [#{word: "bar", menu: "fooMenu", kind: "一二三"}]
+ else
+ return [
+ \ #{word: "一二三四五六七八九十", abbr_hlgroup: "StrikeFake"},
+ \ #{word: "123456789_123456789_123456789_", abbr_hlgroup: "StrikeFake"},
+ \ ]
endif
endfunc
set omnifunc=Omni_test
call term_sendkeys(buf, "\<Esc>:set norightleft\<CR>")
endif
+ call term_sendkeys(buf, ":let g:change=4\<CR>")
+ call TermWait(buf, 50)
+ call term_sendkeys(buf, "S\<C-X>\<C-O>")
+ call VerifyScreenDump(buf, 'Test_pum_maxwidth_23', {'rows': 8})
+ call term_sendkeys(buf, "\<ESC>")
+
call StopVimInTerminal(buf)
endfunc