diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-22 07:55:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-22 07:55:08 +0800 |
commit | edd0de9821ba916e52fed37967d557c82c9fc0e6 (patch) | |
tree | 4625bc963ec1a910304039bd6573e0b10935cc5e /src/nvim/eval/funcs.c | |
parent | 904d0056d520ef01e2873bbaa91a4693e8dfd226 (diff) | |
parent | 9b768752353d3cf99c6cb02e6c1f9d70c029ecb6 (diff) | |
download | rneovim-edd0de9821ba916e52fed37967d557c82c9fc0e6.tar.gz rneovim-edd0de9821ba916e52fed37967d557c82c9fc0e6.tar.bz2 rneovim-edd0de9821ba916e52fed37967d557c82c9fc0e6.zip |
Merge pull request #21149 from zeertzjq/vim-9.0.0916
vim-patch:8.2.{2435,2479},9.0.0916
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r-- | src/nvim/eval/funcs.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 12568ec965..8666aa4f35 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -2671,8 +2671,9 @@ static void get_buffer_lines(buf_T *buf, linenr_T start, linenr_T end, int retli } } -/// "getbufline()" function -static void f_getbufline(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) +/// @param retlist true: "getbufline()" function +/// false: "getbufoneline()" function +static void getbufline(typval_T *argvars, typval_T *rettv, bool retlist) { const int did_emsg_before = did_emsg; buf_T *const buf = tv_get_buf_from_arg(&argvars[0]); @@ -2684,7 +2685,19 @@ static void f_getbufline(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) ? lnum : tv_get_lnum_buf(&argvars[2], buf)); - get_buffer_lines(buf, lnum, end, true, rettv); + get_buffer_lines(buf, lnum, end, retlist, rettv); +} + +/// "getbufline()" function +static void f_getbufline(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) +{ + getbufline(argvars, rettv, true); +} + +/// "getbufoneline()" function +static void f_getbufoneline(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) +{ + getbufline(argvars, rettv, false); } /// "getchangelist()" function |