diff options
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 5975777261..8be25bc34e 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -76,7 +76,7 @@ #include "nvim/tag.h" #include "nvim/tempfile.h" #include "nvim/term.h" -#include "nvim/ui.h" +#include "nvim/mouse.h" #include "nvim/undo.h" #include "nvim/version.h" #include "nvim/window.h" @@ -90,6 +90,7 @@ #include "nvim/api/vim.h" #include "nvim/os/dl.h" #include "nvim/os/event.h" +#include "nvim/os/input.h" #define DICT_MAXNEST 100 /* maximum nesting of lists and dicts */ @@ -8414,7 +8415,7 @@ static void f_feedkeys(typval_T *argvars, typval_T *rettv) } vim_feedkeys(cstr_as_string((char *)keys), - cstr_as_string((char *)flags)); + cstr_as_string((char *)flags), true); } } @@ -10273,12 +10274,6 @@ static void get_user_input(typval_T *argvars, typval_T *rettv, int inputdialog) rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; -#ifdef NO_CONSOLE_INPUT - /* While starting up, there is no place to enter text. */ - if (no_console_input()) - return; -#endif - cmd_silent = FALSE; /* Want to see the prompt. */ if (prompt != NULL) { /* Only the part of the message after the last NL is considered as @@ -10373,11 +10368,6 @@ static void f_inputlist(typval_T *argvars, typval_T *rettv) int selected; int mouse_used; -#ifdef NO_CONSOLE_INPUT - /* While starting up, there is no place to enter text. */ - if (no_console_input()) - return; -#endif if (argvars[0].v_type != VAR_LIST || argvars[0].vval.v_list == NULL) { EMSG2(_(e_listarg), "inputlist()"); return; @@ -10641,10 +10631,10 @@ static void f_jobsend(typval_T *argvars, typval_T *rettv) ssize_t input_len; char *input = (char *) save_tv_as_string(&argvars[1], &input_len, true); - if (input_len < 0) { - return; // Error handled by save_tv_as_string(). - } else if (input_len == 0) { - return; // Not an error, but nothing to do. + if (!input) { + // Either the error has been handled by save_tv_as_string(), or there is no + // input to send. + return; } WBuffer *buf = wstream_new_buffer(input, input_len, 1, free); @@ -14569,7 +14559,8 @@ static void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv, // get input to the shell command (if any), and its length ssize_t input_len; char *input = (char *) save_tv_as_string(&argvars[1], &input_len, false); - if (input_len == -1) { + if (input_len < 0) { + assert(input == NULL); return; } @@ -17281,7 +17272,7 @@ void ex_function(exarg_T *eap) msg_putchar(' '); msg_prt_line(FUNCLINE(fp, j), FALSE); out_flush(); /* show a line at a time */ - ui_breakcheck(); + os_breakcheck(); } if (!got_int) { msg_putchar('\n'); @@ -19306,7 +19297,7 @@ void ex_oldfiles(exarg_T *eap) msg_outtrans(get_tv_string(&li->li_tv)); msg_putchar('\n'); out_flush(); /* output one line at a time */ - ui_breakcheck(); + os_breakcheck(); } /* Assume "got_int" was set to truncate the listing. */ got_int = FALSE; |