mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.0759: showing two characters for tab is limited
Problem: Showing two characters for tab is limited. Solution: Allow for a third character for "tab:" in 'listchars'. (Nathaniel Braun, Ken Takata, closes #3810)
This commit is contained in:
19
src/option.c
19
src/option.c
@@ -7949,7 +7949,7 @@ set_chars_option(char_u **varp)
|
||||
{
|
||||
int round, i, len, entries;
|
||||
char_u *p, *s;
|
||||
int c1, c2 = 0;
|
||||
int c1 = 0, c2 = 0, c3 = 0;
|
||||
struct charstab
|
||||
{
|
||||
int *cp;
|
||||
@@ -8001,8 +8001,12 @@ set_chars_option(char_u **varp)
|
||||
for (i = 0; i < entries; ++i)
|
||||
if (tab[i].cp != NULL)
|
||||
*(tab[i].cp) = (varp == &p_lcs ? NUL : ' ');
|
||||
|
||||
if (varp == &p_lcs)
|
||||
{
|
||||
lcs_tab1 = NUL;
|
||||
lcs_tab3 = NUL;
|
||||
}
|
||||
else
|
||||
fill_diff = '-';
|
||||
}
|
||||
@@ -8016,6 +8020,7 @@ set_chars_option(char_u **varp)
|
||||
&& p[len] == ':'
|
||||
&& p[len + 1] != NUL)
|
||||
{
|
||||
c1 = c2 = c3 = 0;
|
||||
s = p + len + 1;
|
||||
#ifdef FEAT_MBYTE
|
||||
c1 = mb_ptr2char_adv(&s);
|
||||
@@ -8035,7 +8040,18 @@ set_chars_option(char_u **varp)
|
||||
#else
|
||||
c2 = *s++;
|
||||
#endif
|
||||
if (!(*s == ',' || *s == NUL))
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
c3 = mb_ptr2char_adv(&s);
|
||||
if (mb_char2cells(c3) > 1)
|
||||
continue;
|
||||
#else
|
||||
c3 = *s++;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (*s == ',' || *s == NUL)
|
||||
{
|
||||
if (round)
|
||||
@@ -8044,6 +8060,7 @@ set_chars_option(char_u **varp)
|
||||
{
|
||||
lcs_tab1 = c1;
|
||||
lcs_tab2 = c2;
|
||||
lcs_tab3 = c3;
|
||||
}
|
||||
else if (tab[i].cp != NULL)
|
||||
*(tab[i].cp) = c1;
|
||||
|
Reference in New Issue
Block a user