0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 9.1.0027: Vim is missing a foreach() func

Problem:  Vim is missing a foreach() func
Solution: Implement foreach({expr1}, {expr2}) function,
          which applies {expr2} for each item in {expr1}
          without changing it (Ernie Rael)

closes: #12166

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Ernie Rael
2024-01-13 11:47:33 +01:00
committed by Christian Brabandt
parent d8cb1ddab7
commit e79e207760
12 changed files with 303 additions and 61 deletions

View File

@@ -4879,11 +4879,12 @@ typedef struct {
hashtab_T sve_hashtab;
} save_v_event_T;
// Enum used by filter(), map() and mapnew()
// Enum used by filter(), map(), mapnew() and foreach()
typedef enum {
FILTERMAP_FILTER,
FILTERMAP_MAP,
FILTERMAP_MAPNEW
FILTERMAP_MAPNEW,
FILTERMAP_FOREACH
} filtermap_T;
// Structure used by switch_win() to pass values to restore_win()