aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/funcs.c
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-09-24 21:48:53 +0200
committerGitHub <noreply@github.com>2020-09-24 21:48:53 +0200
commitf1fbb9e9ca26a7111dc384951c600bf4dc4ebbfb (patch)
treeb5ed0222bce59f0060692f804a530ed67276a366 /src/nvim/eval/funcs.c
parentb9ceac4650a7d7b731828a4fb82b92d01e88752b (diff)
parenta958039f0ad7cd4f6a139fde18795c88c623a30e (diff)
downloadrneovim-f1fbb9e9ca26a7111dc384951c600bf4dc4ebbfb.tar.gz
rneovim-f1fbb9e9ca26a7111dc384951c600bf4dc4ebbfb.tar.bz2
rneovim-f1fbb9e9ca26a7111dc384951c600bf4dc4ebbfb.zip
Merge pull request #12515 from teto/remove-foldline-final
screen.c: remove fold_line
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r--src/nvim/eval/funcs.c9
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);
}