mirror of
https://github.com/neovim/neovim
synced 2025-07-18 10:11:50 +00:00
Rename stdin to stdin_mode
stdin is a macro in Windows builds.
This commit is contained in:
committed by
James McCoy
parent
915dda3f96
commit
008b83f5a2
@ -289,9 +289,9 @@ static void close_cb(Stream *stream, void *data)
|
|||||||
/// `on_stdout` is ignored
|
/// `on_stdout` is ignored
|
||||||
/// @param[in] detach True if the job should not be killed when nvim exits,
|
/// @param[in] detach True if the job should not be killed when nvim exits,
|
||||||
/// ignored if `pty` is true
|
/// ignored if `pty` is true
|
||||||
/// @param[in] stdin Stdin mode. Either kChannelStdinPipe to open a channel
|
/// @param[in] stdin_mode Stdin mode. Either kChannelStdinPipe to open a
|
||||||
/// for stdin or kChannelStdinNull to leave stdin
|
/// channel for stdin or kChannelStdinNull to leave
|
||||||
/// disconnected.
|
/// stdin disconnected.
|
||||||
/// @param[in] cwd Initial working directory for the job. Nvim's working
|
/// @param[in] cwd Initial working directory for the job. Nvim's working
|
||||||
/// directory if `cwd` is NULL
|
/// directory if `cwd` is NULL
|
||||||
/// @param[in] pty_width Width of the pty, ignored if `pty` is false
|
/// @param[in] pty_width Width of the pty, ignored if `pty` is false
|
||||||
@ -305,7 +305,7 @@ static void close_cb(Stream *stream, void *data)
|
|||||||
Channel *channel_job_start(char **argv, CallbackReader on_stdout,
|
Channel *channel_job_start(char **argv, CallbackReader on_stdout,
|
||||||
CallbackReader on_stderr, Callback on_exit,
|
CallbackReader on_stderr, Callback on_exit,
|
||||||
bool pty, bool rpc, bool overlapped, bool detach,
|
bool pty, bool rpc, bool overlapped, bool detach,
|
||||||
ChannelStdinMode stdin, const char *cwd,
|
ChannelStdinMode stdin_mode, const char *cwd,
|
||||||
uint16_t pty_width, uint16_t pty_height,
|
uint16_t pty_width, uint16_t pty_height,
|
||||||
dict_T *env, varnumber_T *status_out)
|
dict_T *env, varnumber_T *status_out)
|
||||||
{
|
{
|
||||||
@ -357,7 +357,7 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout,
|
|||||||
has_err = callback_reader_set(chan->on_stderr);
|
has_err = callback_reader_set(chan->on_stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (stdin) {
|
switch (stdin_mode) {
|
||||||
case kChannelStdinPipe:
|
case kChannelStdinPipe:
|
||||||
has_in = true;
|
has_in = true;
|
||||||
break;
|
break;
|
||||||
|
@ -5181,7 +5181,7 @@ static void f_jobstart(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
bool pty = false;
|
bool pty = false;
|
||||||
bool clear_env = false;
|
bool clear_env = false;
|
||||||
bool overlapped = false;
|
bool overlapped = false;
|
||||||
ChannelStdinMode stdin = kChannelStdinPipe;
|
ChannelStdinMode stdin_mode = kChannelStdinPipe;
|
||||||
CallbackReader on_stdout = CALLBACK_READER_INIT,
|
CallbackReader on_stdout = CALLBACK_READER_INIT,
|
||||||
on_stderr = CALLBACK_READER_INIT;
|
on_stderr = CALLBACK_READER_INIT;
|
||||||
Callback on_exit = CALLBACK_NONE;
|
Callback on_exit = CALLBACK_NONE;
|
||||||
@ -5199,7 +5199,7 @@ static void f_jobstart(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
char *s = tv_dict_get_string(job_opts, "stdin", false);
|
char *s = tv_dict_get_string(job_opts, "stdin", false);
|
||||||
if (s) {
|
if (s) {
|
||||||
if (!strncmp(s, "null", NUMBUFLEN)) {
|
if (!strncmp(s, "null", NUMBUFLEN)) {
|
||||||
stdin = kChannelStdinNull;
|
stdin_mode = kChannelStdinNull;
|
||||||
} else if (!strncmp(s, "pipe", NUMBUFLEN)) {
|
} else if (!strncmp(s, "pipe", NUMBUFLEN)) {
|
||||||
// Nothing to do, default value
|
// Nothing to do, default value
|
||||||
} else {
|
} else {
|
||||||
@ -5263,8 +5263,8 @@ static void f_jobstart(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
env = create_environment(job_env, clear_env, pty, term_name);
|
env = create_environment(job_env, clear_env, pty, term_name);
|
||||||
|
|
||||||
Channel *chan = channel_job_start(argv, on_stdout, on_stderr, on_exit, pty,
|
Channel *chan = channel_job_start(argv, on_stdout, on_stderr, on_exit, pty,
|
||||||
rpc, overlapped, detach, stdin, cwd, width,
|
rpc, overlapped, detach, stdin_mode, cwd,
|
||||||
height, env, &rettv->vval.v_number);
|
width, height, env, &rettv->vval.v_number);
|
||||||
if (chan) {
|
if (chan) {
|
||||||
channel_create_event(chan, NULL);
|
channel_create_event(chan, NULL);
|
||||||
}
|
}
|
||||||
@ -10862,11 +10862,11 @@ static void f_termopen(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
const bool rpc = false;
|
const bool rpc = false;
|
||||||
const bool overlapped = false;
|
const bool overlapped = false;
|
||||||
const bool detach = false;
|
const bool detach = false;
|
||||||
ChannelStdinMode stdin = kChannelStdinPipe;
|
ChannelStdinMode stdin_mode = kChannelStdinPipe;
|
||||||
uint16_t term_width = MAX(0, curwin->w_width_inner - win_col_off(curwin));
|
uint16_t term_width = MAX(0, curwin->w_width_inner - win_col_off(curwin));
|
||||||
Channel *chan = channel_job_start(argv, on_stdout, on_stderr, on_exit,
|
Channel *chan = channel_job_start(argv, on_stdout, on_stderr, on_exit,
|
||||||
pty, rpc, overlapped, detach, stdin, cwd,
|
pty, rpc, overlapped, detach, stdin_mode,
|
||||||
term_width, curwin->w_height_inner,
|
cwd, term_width, curwin->w_height_inner,
|
||||||
env, &rettv->vval.v_number);
|
env, &rettv->vval.v_number);
|
||||||
if (rettv->vval.v_number <= 0) {
|
if (rettv->vval.v_number <= 0) {
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user