diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-01-16 08:00:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-16 08:00:08 +0800 |
commit | 73e1942abe7a96d63ce3749af4187f2cdff87e69 (patch) | |
tree | bd508b354771b2c01bbcc41dc83fb82a3d0d38b7 /src/nvim/eval/typval.c | |
parent | ae48d965d70cc721a3165c40ba0c34d95408e229 (diff) | |
download | rneovim-73e1942abe7a96d63ce3749af4187f2cdff87e69.tar.gz rneovim-73e1942abe7a96d63ce3749af4187f2cdff87e69.tar.bz2 rneovim-73e1942abe7a96d63ce3749af4187f2cdff87e69.zip |
vim-patch:9.1.0009: Cannot easily get the list of matches (#27028)
Problem: Cannot easily get the list of matches
Solution: Add the matchstrlist() and matchbufline() Vim script
functions (Yegappan Lakshmanan)
closes: vim/vim#13766
Omit CHECK_LIST_MATERIALIZE(): it populates a List with numbers only,
and there is a check for strings below.
https://github.com/vim/vim/commit/f93b1c881a99fa847a1bafa71877d7e16f18e6ef
vim-patch:eb3475df0d92
runtime(doc): Replace non-breaking space with normal space (vim/vim#13868)
https://github.com/vim/vim/commit/eb3475df0d927a178789cf8e7fc4983932e1cdbe
Co-authored-by: Yegappan Lakshmanan <4298407+yegappan@users.noreply.github.com>
Diffstat (limited to 'src/nvim/eval/typval.c')
-rw-r--r-- | src/nvim/eval/typval.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 2892cb60f9..d510cf2a3d 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -4346,6 +4346,22 @@ int tv_check_for_string_or_number_arg(const typval_T *const args, const int idx) return OK; } +/// Give an error and return FAIL unless "args[idx]" is a buffer number. +/// Buffer number can be a number or a string. +int tv_check_for_buffer_arg(const typval_T *const args, const int idx) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE +{ + return tv_check_for_string_or_number_arg(args, idx); +} + +/// Give an error and return FAIL unless "args[idx]" is a line number. +/// Line number can be a number or a string. +int tv_check_for_lnum_arg(const typval_T *const args, const int idx) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE +{ + return tv_check_for_string_or_number_arg(args, idx); +} + /// Give an error and return FAIL unless "args[idx]" is a string or a list. int tv_check_for_string_or_list_arg(const typval_T *const args, const int idx) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE |