forked from aniani/vim
patch 8.2.2633: multi-byte 'fillchars' for folding do not show properly
Problem: Multi-byte 'fillchars' for folding do not show properly. Solution: Handle multi-byte characters correctly. (Yegappan Lakshmanan, closes #7983, closes #7955)
This commit is contained in:
@@ -295,8 +295,13 @@ fill_foldcolumn(
|
|||||||
if (closed)
|
if (closed)
|
||||||
{
|
{
|
||||||
if (symbol != 0)
|
if (symbol != 0)
|
||||||
// rollback length
|
{
|
||||||
|
// rollback length and the character
|
||||||
byte_counter -= len;
|
byte_counter -= len;
|
||||||
|
if (len > 1)
|
||||||
|
// for a multibyte character, erase all the bytes
|
||||||
|
vim_memset(p + byte_counter, ' ', len);
|
||||||
|
}
|
||||||
symbol = fill_foldclosed;
|
symbol = fill_foldclosed;
|
||||||
len = utf_char2bytes(symbol, &p[byte_counter]);
|
len = utf_char2bytes(symbol, &p[byte_counter]);
|
||||||
byte_counter += len;
|
byte_counter += len;
|
||||||
|
@@ -1061,6 +1061,12 @@ func Test_foldcolumn_multibyte_char()
|
|||||||
set fillchars+=foldopen:▾,foldsep:│,foldclose:▸
|
set fillchars+=foldopen:▾,foldsep:│,foldclose:▸
|
||||||
call s:mbyte_fillchar_tests('▾', '▸', '│')
|
call s:mbyte_fillchar_tests('▾', '▸', '│')
|
||||||
|
|
||||||
|
" Use a mix of multi-byte and single-byte characters
|
||||||
|
set fillchars+=foldopen:¬,foldsep:\|,foldclose:+
|
||||||
|
call s:mbyte_fillchar_tests('¬', '+', '|')
|
||||||
|
set fillchars+=foldopen:+,foldsep:\|,foldclose:¬
|
||||||
|
call s:mbyte_fillchar_tests('+', '¬', '|')
|
||||||
|
|
||||||
bw!
|
bw!
|
||||||
set foldenable& fdc& fdm& fillchars&
|
set foldenable& fdc& fdm& fillchars&
|
||||||
endfunc
|
endfunc
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2633,
|
||||||
/**/
|
/**/
|
||||||
2632,
|
2632,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user