0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.0918: duplicate code for evaluating expression argument

Problem:    Duplicate code for evaluating expression argument.
Solution:   Merge the code and make the use more flexible.
This commit is contained in:
Bram Moolenaar
2020-06-07 14:50:50 +02:00
parent e928366de5
commit a9c0104947
7 changed files with 28 additions and 121 deletions

View File

@@ -4130,20 +4130,6 @@ typedef struct
int sa_wrapped; // search wrapped around
} searchit_arg_T;
/*
* Function argument that can be a string, funcref or partial.
* - declare: evalarg_T name;
* - init: CLEAR_FIELD(name);
* - set: evalarg_get(&argvars[3], &name);
* - use: if (evalarg_valid(&name)) res = evalarg_call(&name);
* - cleanup: evalarg_clean(&name);
*/
typedef struct
{
char_u eva_buf[NUMBUFLEN]; // buffer for get_tv_string_buf()
char_u *eva_string;
callback_T eva_callback;
} evalarg_T;
#define WRITEBUFSIZE 8192 // size of normal write buffer