This commit is contained in:
James McCoy 2017-04-07 16:38:06 -04:00
parent 98dd9b8012
commit 123931e65e

View File

@ -8729,8 +8729,9 @@ static void f_foldtextresult(typval_T *argvars, typval_T *rettv, FunPtr fptr)
fold_count = foldedCount(curwin, lnum, &foldinfo);
if (fold_count > 0) {
text = get_foldtext(curwin, lnum, lnum + fold_count - 1, &foldinfo, buf);
if (text == buf)
if (text == buf) {
text = vim_strsave(text);
}
rettv->vval.v_string = text;
}
}