patch 9.1.1819: Cannot configure the inner foldlevel indicator
Problem: Cannot configure the inner foldlevel indicator for the
foldcolumn
Solution: Add "foldinner" suboption value to the 'fillchar' option
(Maria José Solano).
closes: #18365
Signed-off-by: Maria José Solano <majosolano99@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
09b1ce0860
commit
1a691afd27
@ -287,6 +287,8 @@ fill_foldcolumn(
|
||||
symbol = wp->w_fill_chars.foldopen;
|
||||
else if (first_level == 1)
|
||||
symbol = wp->w_fill_chars.foldsep;
|
||||
else if (wp->w_fill_chars.foldinner != NUL)
|
||||
symbol = wp->w_fill_chars.foldinner;
|
||||
else if (first_level + i <= 9)
|
||||
symbol = '0' + first_level + i;
|
||||
else
|
||||
@ -4738,6 +4740,7 @@ static struct charstab filltab[] =
|
||||
CHARSTAB_ENTRY(&fill_chars.foldopen, "foldopen"),
|
||||
CHARSTAB_ENTRY(&fill_chars.foldclosed, "foldclose"),
|
||||
CHARSTAB_ENTRY(&fill_chars.foldsep, "foldsep"),
|
||||
CHARSTAB_ENTRY(&fill_chars.foldinner, "foldinner"),
|
||||
CHARSTAB_ENTRY(&fill_chars.diff, "diff"),
|
||||
CHARSTAB_ENTRY(&fill_chars.eob, "eob"),
|
||||
CHARSTAB_ENTRY(&fill_chars.lastline, "lastline"),
|
||||
@ -4856,6 +4859,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply,
|
||||
fill_chars.foldopen = '-';
|
||||
fill_chars.foldclosed = '+';
|
||||
fill_chars.foldsep = '|';
|
||||
fill_chars.foldinner = NUL;
|
||||
fill_chars.diff = '-';
|
||||
fill_chars.eob = '~';
|
||||
fill_chars.lastline = '@';
|
||||
|
||||
@ -3913,6 +3913,7 @@ typedef struct
|
||||
int foldopen;
|
||||
int foldclosed;
|
||||
int foldsep;
|
||||
int foldinner;
|
||||
int diff;
|
||||
int eob;
|
||||
int lastline;
|
||||
|
||||
@ -340,6 +340,32 @@ func Test_fold_fillchars()
|
||||
\ ]
|
||||
call assert_equal(expected, lines)
|
||||
|
||||
" check setting foldinner
|
||||
set fdc=1 foldmethod=indent foldlevel=10
|
||||
call setline(1, ['one', ' two', ' two', ' three', ' three', 'four'])
|
||||
let lines = ScreenLines([1, 6], 22)
|
||||
let expected = [
|
||||
\ ' one ',
|
||||
\ '[ two ',
|
||||
\ '- two ',
|
||||
\ '[ three',
|
||||
\ '2 three',
|
||||
\ ' four ',
|
||||
\ ]
|
||||
call assert_equal(expected, lines)
|
||||
|
||||
set fillchars+=foldinner:\
|
||||
let lines = ScreenLines([1, 6], 22)
|
||||
let expected = [
|
||||
\ ' one ',
|
||||
\ '[ two ',
|
||||
\ '- two ',
|
||||
\ '[ three',
|
||||
\ ' three',
|
||||
\ ' four ',
|
||||
\ ]
|
||||
call assert_equal(expected, lines)
|
||||
|
||||
%bw!
|
||||
set fillchars& fdc& foldmethod& foldenable&
|
||||
endfunc
|
||||
|
||||
@ -729,6 +729,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1819,
|
||||
/**/
|
||||
1818,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user