Mercurial > vim
diff src/evalfunc.c @ 23604:1816ea68c022 v8.2.2344
patch 8.2.2344: using inclusive index for slice is not always desired
Commit: https://github.com/vim/vim/commit/6601b62943a19d4f8818c3638440663d67a17b6a
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jan 13 21:47:15 2021 +0100
patch 8.2.2344: using inclusive index for slice is not always desired
Problem: Using inclusive index for slice is not always desired.
Solution: Add the slice() method, which has an exclusive index. (closes
#7408)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 13 Jan 2021 22:00:04 +0100 |
parents | 7b3317e959e3 |
children | 8dcb2255ff9a |
line wrap: on
line diff
--- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1500,6 +1500,8 @@ static funcentry_T global_functions[] = ret_float, FLOAT_FUNC(f_sin)}, {"sinh", 1, 1, FEARG_1, NULL, ret_float, FLOAT_FUNC(f_sinh)}, + {"slice", 2, 3, FEARG_1, NULL, + ret_first_arg, f_slice}, {"sort", 1, 3, FEARG_1, NULL, ret_first_arg, f_sort}, {"sound_clear", 0, 0, 0, NULL,