mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +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
|
||||
/// @param[in] detach True if the job should not be killed when nvim exits,
|
||||
/// ignored if `pty` is true
|
||||
/// @param[in] stdin Stdin mode. Either kChannelStdinPipe to open a channel
|
||||
/// for stdin or kChannelStdinNull to leave stdin
|
||||
/// disconnected.
|
||||
/// @param[in] stdin_mode Stdin mode. Either kChannelStdinPipe to open a
|
||||
/// channel for stdin or kChannelStdinNull to leave
|
||||
/// stdin disconnected.
|
||||
/// @param[in] cwd Initial working directory for the job. Nvim's working
|
||||
/// directory if `cwd` is NULL
|
||||
/// @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,
|
||||
CallbackReader on_stderr, Callback on_exit,
|
||||
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,
|
||||
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);
|
||||
}
|
||||
|
||||
switch (stdin) {
|
||||
switch (stdin_mode) {
|
||||
case kChannelStdinPipe:
|
||||
has_in = true;
|
||||
break;
|
||||
|
@ -5181,7 +5181,7 @@ static void f_jobstart(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
bool pty = false;
|
||||
bool clear_env = false;
|
||||
bool overlapped = false;
|
||||
ChannelStdinMode stdin = kChannelStdinPipe;
|
||||
ChannelStdinMode stdin_mode = kChannelStdinPipe;
|
||||
CallbackReader on_stdout = CALLBACK_READER_INIT,
|
||||
on_stderr = CALLBACK_READER_INIT;
|
||||
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);
|
||||
if (s) {
|
||||
if (!strncmp(s, "null", NUMBUFLEN)) {
|
||||
stdin = kChannelStdinNull;
|
||||
stdin_mode = kChannelStdinNull;
|
||||
} else if (!strncmp(s, "pipe", NUMBUFLEN)) {
|
||||
// Nothing to do, default value
|
||||
} 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);
|
||||
|
||||
Channel *chan = channel_job_start(argv, on_stdout, on_stderr, on_exit, pty,
|
||||
rpc, overlapped, detach, stdin, cwd, width,
|
||||
height, env, &rettv->vval.v_number);
|
||||
rpc, overlapped, detach, stdin_mode, cwd,
|
||||
width, height, env, &rettv->vval.v_number);
|
||||
if (chan) {
|
||||
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 overlapped = 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));
|
||||
Channel *chan = channel_job_start(argv, on_stdout, on_stderr, on_exit,
|
||||
pty, rpc, overlapped, detach, stdin, cwd,
|
||||
term_width, curwin->w_height_inner,
|
||||
pty, rpc, overlapped, detach, stdin_mode,
|
||||
cwd, term_width, curwin->w_height_inner,
|
||||
env, &rettv->vval.v_number);
|
||||
if (rettv->vval.v_number <= 0) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user