mirror of
https://github.com/neovim/neovim.git
synced 2025-09-10 21:38:19 +00:00
feat(--headless): add on_print callback to stdioopen
This commit adds an on_print callback to stdioopen's dictionary argument which lets the caller specify a function called each time neovim will try to output something to stdout (e.g. on "echo" or "echoerr" in --headless mode).
This commit is contained in:
@@ -10213,6 +10213,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;
|
||||
|
Reference in New Issue
Block a user