diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2022-02-01 12:44:14 +0000 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2022-02-12 12:00:36 +0000 |
commit | cdb2c100118ab788772a6a0a1d60f555370fd201 (patch) | |
tree | 744caa88947432672753f274876ce726d866c1f3 /src/nvim/eval.h | |
parent | a7321e37a75fff5c0048b0779cf91d504455d6f3 (diff) | |
download | rneovim-cdb2c100118ab788772a6a0a1d60f555370fd201.tar.gz rneovim-cdb2c100118ab788772a6a0a1d60f555370fd201.tar.bz2 rneovim-cdb2c100118ab788772a6a0a1d60f555370fd201.zip |
vim-patch:8.2.0915: search() cannot skip over matches like searchpair() can
Problem: Search() cannot skip over matches like searchpair() can.
Solution: Add an optional "skip" argument. (Christian Brabandt, closes vim/vim#861)
https://github.com/vim/vim/commit/adc17a5f9d207fd1623fd923457a46efc9214777
Enable skip arg usage in autoload/freebasic.vim
evalarg_T doesn't really matter because it's deleted in v8.2.0918 (and
reincarnated for Vim9 script in v8.2.1047), but I found out too late :P Anyway:
- Port evalarg_T into eval.h and use const char * and Callback fields
- Use EVALARG_INIT to initialize
- Return bool over OK/FAIL from evalarg functions
- Remove check from evalarg_clean as callback_free ignores None callbacks anyway
- Move eva_buf field into evalarg_get as a local (not sure what reason it has
being in the struct)
N/A patches for version.c:
vim-patch:8.2.4355: unnecessary call to check_colorcolumn()
Problem: Unnecessary call to check_colorcolumn().
Solution: Remove the call. (Sean Dewar, closes vim/vim#9748)
https://github.com/vim/vim/commit/0f7ff851cb721bb3c07261adbf82b591229f530d
Diffstat (limited to 'src/nvim/eval.h')
-rw-r--r-- | src/nvim/eval.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/eval.h b/src/nvim/eval.h index a9ec5d47a6..f74f23d084 100644 --- a/src/nvim/eval.h +++ b/src/nvim/eval.h @@ -272,6 +272,22 @@ typedef int (*ex_unletlock_callback)(lval_T *, char_u *, exarg_T *, int); // Used for checking if local variables or arguments used in a lambda. extern bool *eval_lavars_used; +/// Function argument that can be a string, funcref or partial. +/// - declare: evalarg_T name; +/// - init: name = EVALARG_INIT; +/// - set: evalarg_get(&argvars[3], &name); +/// - use: if (evalarg_valid(&name)) res = evalarg_call(&name); +/// - cleanup: evalarg_clean(&name); +typedef struct { + const char *eva_string; + Callback eva_callback; +} evalarg_T; + +#define EVALARG_INIT (evalarg_T) { \ + .eva_string = NULL, \ + .eva_callback = CALLBACK_NONE, \ +} + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval.h.generated.h" #endif |