diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-01-24 22:33:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 22:33:55 +0100 |
commit | 1b6ae2dbb0aa24748d44752407cd18b5abec1d0a (patch) | |
tree | 5a518f3dfb4b6af6afb0180017984b523333b09d /src/nvim/eval | |
parent | 1907a9481423ccf4433f8184bbfdc633589e43f5 (diff) | |
parent | a4069a3eed65f14b1149c6cda8638dcb49ab5027 (diff) | |
download | rneovim-1b6ae2dbb0aa24748d44752407cd18b5abec1d0a.tar.gz rneovim-1b6ae2dbb0aa24748d44752407cd18b5abec1d0a.tar.bz2 rneovim-1b6ae2dbb0aa24748d44752407cd18b5abec1d0a.zip |
Merge pull request #15910 from glacambre/silent_stdioopen
feat(--headless): do not print anything when stdioopen() has been used
Diffstat (limited to 'src/nvim/eval')
-rw-r--r-- | src/nvim/eval/funcs.c | 4 | ||||
-rw-r--r-- | src/nvim/eval/typval.h | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 7701688b49..4a07f6a850 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -10215,6 +10215,10 @@ static void f_stdioopen(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (!tv_dict_get_callback(opts, S_LEN("on_stdin"), &on_stdin.cb)) { return; } + if (!tv_dict_get_callback(opts, S_LEN("on_print"), &on_print)) { + return; + } + on_stdin.buffered = tv_dict_get_number(opts, "stdin_buffered"); if (on_stdin.buffered && on_stdin.cb.type == kCallbackNone) { on_stdin.self = opts; diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h index d1275d6512..ad01c01499 100644 --- a/src/nvim/eval/typval.h +++ b/src/nvim/eval/typval.h @@ -81,7 +81,8 @@ typedef struct { } data; CallbackType type; } Callback; -#define CALLBACK_NONE ((Callback){ .type = kCallbackNone }) +#define CALLBACK_INIT { .type = kCallbackNone } +#define CALLBACK_NONE ((Callback)CALLBACK_INIT) /// Structure holding dictionary watcher typedef struct dict_watcher { |