Mercurial > vim
diff src/option.c @ 15502:bc17a9d37810 v8.1.0759
patch 8.1.0759: showing two characters for tab is limited
commit https://github.com/vim/vim/commit/83a52171ba00b2b9fd2d1d22a07e38fc9fc69c1e
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jan 16 22:41:54 2019 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 16 Jan 2019 22:45:07 +0100 |
parents | 126cdab63a83 |
children | dd725a8ab112 |
line wrap: on
line diff
--- a/src/option.c +++ b/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;