0
0
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:
Bram Moolenaar
2019-01-16 22:41:54 +01:00
parent 500f361080
commit 83a52171ba
7 changed files with 118 additions and 11 deletions

View File

@@ -1771,6 +1771,7 @@ msg_prt_line(char_u *s, int list)
int col = 0;
int n_extra = 0;
int c_extra = 0;
int c_final = 0;
char_u *p_extra = NULL; /* init to make SASC shut up */
int n;
int attr = 0;
@@ -1801,7 +1802,9 @@ msg_prt_line(char_u *s, int list)
if (n_extra > 0)
{
--n_extra;
if (c_extra)
if (n_extra == 0 && c_final)
c = c_final;
else if (c_extra)
c = c_extra;
else
c = *p_extra++;
@@ -1844,11 +1847,13 @@ msg_prt_line(char_u *s, int list)
{
c = ' ';
c_extra = ' ';
c_final = NUL;
}
else
{
c = lcs_tab1;
c = (n_extra == 0 && lcs_tab3) ? lcs_tab3 : lcs_tab1;
c_extra = lcs_tab2;
c_final = lcs_tab3;
attr = HL_ATTR(HLF_8);
}
}
@@ -1861,6 +1866,7 @@ msg_prt_line(char_u *s, int list)
{
p_extra = (char_u *)"";
c_extra = NUL;
c_final = NUL;
n_extra = 1;
c = lcs_eol;
attr = HL_ATTR(HLF_AT);
@@ -1871,6 +1877,7 @@ msg_prt_line(char_u *s, int list)
n_extra = n - 1;
p_extra = transchar_byte(c);
c_extra = NUL;
c_final = NUL;
c = *p_extra++;
/* Use special coloring to be able to distinguish <hex> from
* the same in plain text. */