From b9054e3de53ab61b653e6744c536bf53e3076ab7 Mon Sep 17 00:00:00 2001 From: amin roosta Date: Sun, 15 Dec 2024 18:18:50 -0500 Subject: [PATCH 1/2] Adds anyfold_fold_fillchar option --- README.md | 1 + autoload/anyfold.vim | 3 ++- doc/anyfold.txt | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d10ff9..019e51a 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ Option | Values | Default value | Description `anyfold_fold_toplevel` | 0, 1 | 0 | Fold subsequent unindented lines `anyfold_fold_size_str` | string | '%s lines' | Format of fold size string in minimalistic display `anyfold_fold_level_str` | string | ' + ' | Format of fold level string in minimalistic display +anyfold_fold_fillchar | string | ' ' | Fold fill character ## Complementary plugins diff --git a/autoload/anyfold.vim b/autoload/anyfold.vim index bf0022c..1b1b3f2 100644 --- a/autoload/anyfold.vim +++ b/autoload/anyfold.vim @@ -45,6 +45,7 @@ function! anyfold#init(force) abort \ 'motion': 1, \ 'debug': 0, \ 'fold_size_str': '%s lines', + \ 'fold_fillchar': ' ', \ 'fold_level_str': ' + ', \ } lockvar! g:_ANYFOLD_DEFAULTS @@ -665,7 +666,7 @@ function! MinimalFoldText() abort let foldSizeStr = " " . substitute(g:anyfold_fold_size_str, "%s", string(foldSize), "g") . " " let foldLevelStr = repeat(g:anyfold_fold_level_str, v:foldlevel) let lineCount = line("$") - let expansionString = repeat(" ", w - strwidth(foldSizeStr.line.foldLevelStr)) + let expansionString = repeat(g:anyfold_fold_fillchar, w - strwidth(foldSizeStr.line.foldLevelStr)) return line . expansionString . foldSizeStr . foldLevelStr endfunction diff --git a/doc/anyfold.txt b/doc/anyfold.txt index 22cc669..2f4a30c 100644 --- a/doc/anyfold.txt +++ b/doc/anyfold.txt @@ -102,6 +102,7 @@ g:anyfold_comments | list of strings | ['comment', 'string'] | g:anyfold_fold_toplevel | 0, 1 | 0 (= 'off') | g:anyfold_fold_size_str | string | '%s lines' | Format of fold size string in minimalistic display g:anyfold_fold_level_str | string | ' + ' | Format of fold level string in minimalistic display +g:anyfold_fold_fillchar | string | ' ' | Fold fill character *anyfoldLoaded* For expert configuration, anyfold triggers an |autocmd-event| `anyfoldLoaded` From cbea70e748c234f44a156b76d7d4a0759a4a7383 Mon Sep 17 00:00:00 2001 From: amin roosta Date: Sun, 15 Dec 2024 18:28:11 -0500 Subject: [PATCH 2/2] add an space character after the line --- autoload/anyfold.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/anyfold.vim b/autoload/anyfold.vim index 1b1b3f2..f3f5ef2 100644 --- a/autoload/anyfold.vim +++ b/autoload/anyfold.vim @@ -666,8 +666,8 @@ function! MinimalFoldText() abort let foldSizeStr = " " . substitute(g:anyfold_fold_size_str, "%s", string(foldSize), "g") . " " let foldLevelStr = repeat(g:anyfold_fold_level_str, v:foldlevel) let lineCount = line("$") - let expansionString = repeat(g:anyfold_fold_fillchar, w - strwidth(foldSizeStr.line.foldLevelStr)) - return line . expansionString . foldSizeStr . foldLevelStr + let expansionString = repeat(g:anyfold_fold_fillchar, w - strwidth(foldSizeStr.line." ".foldLevelStr)) + return line . " " . expansionString . foldSizeStr . foldLevelStr endfunction "----------------------------------------------------------------------------/