diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-09-21 14:50:24 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2020-09-24 19:31:58 +0200 |
commit | a958039f0ad7cd4f6a139fde18795c88c623a30e (patch) | |
tree | ad295c6bd9680e69132bba6f3575aa1ee8a702cf /src/nvim/eval/funcs.c | |
parent | f8134f2fd1e2effe79d011b1ff12ebb8719c3ffe (diff) | |
download | rneovim-a958039f0ad7cd4f6a139fde18795c88c623a30e.tar.gz rneovim-a958039f0ad7cd4f6a139fde18795c88c623a30e.tar.bz2 rneovim-a958039f0ad7cd4f6a139fde18795c88c623a30e.zip |
screen: more work on fold_line replacement
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r-- | src/nvim/eval/funcs.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 3a4b4f2a50..bd77a3b7e2 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -2584,8 +2584,6 @@ static void f_foldtextresult(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *text; char_u buf[FOLD_TEXT_LEN]; - foldinfo_T foldinfo; - int fold_count; static bool entered = false; rettv->v_type = VAR_STRING; @@ -2599,9 +2597,10 @@ static void f_foldtextresult(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (lnum < 0) { lnum = 0; } - fold_count = foldedCount(curwin, lnum, &foldinfo); - if (fold_count > 0) { - text = get_foldtext(curwin, lnum, lnum + fold_count - 1, &foldinfo, buf); + + foldinfo_T info = fold_info(curwin, lnum); + if (info.fi_lines > 0) { + text = get_foldtext(curwin, lnum, lnum + info.fi_lines - 1, info, buf); if (text == buf) { text = vim_strsave(text); } |