0
0
mirror of https://github.com/vim/vim.git synced 2025-11-15 23:14:06 -05:00

patch 9.1.1284: not possible to configure pum truncation char

Problem:  not possible to configure the completion menu truncation
          character
Solution: add the "trunc" suboption to the 'fillchars' setting to
          configure the truncation indicator (glepnir).

closes: #17006

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2025-04-07 20:57:14 +02:00
committed by Christian Brabandt
parent 2ffb4d0298
commit b87620466c
36 changed files with 337 additions and 271 deletions

View File

@@ -4712,7 +4712,8 @@ static struct charstab filltab[] =
CHARSTAB_ENTRY(&fill_chars.foldsep, "foldsep"),
CHARSTAB_ENTRY(&fill_chars.diff, "diff"),
CHARSTAB_ENTRY(&fill_chars.eob, "eob"),
CHARSTAB_ENTRY(&fill_chars.lastline, "lastline")
CHARSTAB_ENTRY(&fill_chars.lastline, "lastline"),
CHARSTAB_ENTRY(&fill_chars.trunc, "trunc"),
};
static lcs_chars_T lcs_chars;
static struct charstab lcstab[] =
@@ -4826,6 +4827,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply,
fill_chars.diff = '-';
fill_chars.eob = '~';
fill_chars.lastline = '@';
fill_chars.trunc = '>';
}
}
p = value;
@@ -4837,6 +4839,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply,
continue;
s = p + tab[i].name.length + 1;
if (is_listchars && STRCMP(tab[i].name.string, "multispace") == 0)
{
if (round == 0)
@@ -4858,7 +4861,6 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply,
return field_value_err(errbuf, errbuflen,
e_wrong_number_of_characters_for_field_str,
tab[i].name.string);
p = s;
}
else
{
@@ -4870,8 +4872,8 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply,
if (p == last_multispace && lcs_chars.multispace != NULL)
lcs_chars.multispace[multispace_pos++] = c1;
}
p = s;
}
p = s;
break;
}
@@ -4879,7 +4881,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply,
{
if (round == 0)
{
// get length of lcs-leadmultispace string in first
// Get length of lcs-leadmultispace string in first
// round
last_lmultispace = p;
lead_multispace_len = 0;
@@ -4897,7 +4899,6 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply,
return field_value_err(errbuf, errbuflen,
e_wrong_number_of_characters_for_field_str,
tab[i].name.string);
p = s;
}
else
{
@@ -4909,8 +4910,8 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply,
if (p == last_lmultispace && lcs_chars.leadmultispace != NULL)
lcs_chars.leadmultispace[multispace_pos++] = c1;
}
p = s;
}
p = s;
break;
}