]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1819: Cannot configure the inner foldlevel indicator v9.1.1819
authorMaria José Solano <majosolano99@gmail.com>
Fri, 3 Oct 2025 08:24:31 +0000 (08:24 +0000)
committerChristian Brabandt <cb@256bit.org>
Fri, 3 Oct 2025 08:24:31 +0000 (08:24 +0000)
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>
runtime/doc/fold.txt
runtime/doc/options.txt
runtime/doc/version9.txt
src/screen.c
src/structs.h
src/testdir/test_display.vim
src/version.c

index d138e0d93fa82bccef830740c752c3609dd08c62..40cff059c6750718274b2c1f79b660f35eecc867 100644 (file)
@@ -1,4 +1,4 @@
-*fold.txt*      For Vim version 9.1.  Last change: 2025 Jul 15
+*fold.txt*      For Vim version 9.1.  Last change: 2025 Oct 03
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -595,7 +595,8 @@ A closed fold is indicated with a '+'.
 These characters can be changed with the 'fillchars' option.
 
 Where the fold column is too narrow to display all nested folds, digits are
-shown to indicate the nesting level.
+shown to indicate the nesting level.  To override this behavior you can use
+the "foldinner" character of the 'fillchars' option.
 
 The mouse can also be used to open and close folds by clicking in the
 fold column:
index d0e587b4f774203101bc52aff078af9b25f60bf9..0b86c419040f93c3a66f55ad0c32a0c035c4f353 100644 (file)
@@ -3853,6 +3853,9 @@ A jump table for the options with a short description can be found at |Q_op|.
          foldopen      '-'             mark the beginning of a fold
          foldclose     '+'             show a closed fold
          foldsep       '|'             open fold middle character
+         foldinner     none            character to show instead of the
+                                       numeric foldlevel when it would be
+                                       repeated in a narrow 'foldcolumn'
          diff          '-'             deleted lines of the 'diff' option
          eob           '~'             empty lines below the end of a buffer
          lastline      '@'             'display' contains lastline/truncate
index 910a036141041bf5e4b328f4bb80cfd2feb337dd..6ae6d0118f5d018cbeced8cede4518a8ac22e632 100644 (file)
@@ -1,4 +1,4 @@
-*version9.txt*  For Vim version 9.1.  Last change: 2025 Sep 29
+*version9.txt*  For Vim version 9.1.  Last change: 2025 Oct 03
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -322,6 +322,8 @@ Improvements in 'fillchars':
   "eob" in 'fillchars'.
 - Support for using multibyte items with the "stl", "stlnc", "foldopen",
   "foldclose" and "foldsep" items in the 'fillchars' option.
+- Support for configuring the character used inside a fold level region using
+  "foldinner" in 'fillchars'.
 
 Support for the XChaCha20 encryption method. 'cryptmethod'
 
@@ -41702,7 +41704,9 @@ Options: ~
 - new option values for 'fillchars':
        "trunc"         - configure truncation indicator, 'pummaxwidth'
        "truncrl"       - like "trunc" but in 'rl' mode, 'pummaxwidth'
-       "tpl_vert"      - separators for the 'tabpanel'
+       "tpl_vert"      - vertical separators for the 'tabpanel'
+       "foldinner"     - character used inside the 'foldcolumn' for nested
+                         fold levels
 - 'grepformat' is now a |global-local| option.
 - adjust for GTK3 dropping some mouse cursors 'mouseshape'
 - 'nrformats' accepts the new "blank" suboption, to determine a signed or
index 3e3c86f37a86abf7bad44e91ccca7c8a80da078e..122c2b950b0a54da22bd68e2f939b667cbcc08f7 100644 (file)
@@ -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 = '@';
index f39f5d3a64e08cb80c9c56384995536883841986..8d90fa8ddba429d084984fca2aaf118e381e100c 100644 (file)
@@ -3913,6 +3913,7 @@ typedef struct
     int        foldopen;
     int        foldclosed;
     int        foldsep;
+    int        foldinner;
     int        diff;
     int        eob;
     int        lastline;
index ed8495984e4e472a8b4179ad41fae615388b280f..6bcc8a241eea4675483364e0473ae05cd52a0eb5 100644 (file)
@@ -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
index 0565a8216ac20ee9535881f5e79b6a01520c4579..431536543aa5422c24155de4a4284b4031df7a34 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1819,
 /**/
     1818,
 /**/