input: skip dialogs if no UI is active

Treat dialogs in the same way as "silent mode" (`nvim -es`).

References #1984
References #3901
This commit is contained in:
Justin M. Keyes
2017-08-06 02:44:15 +02:00
parent d801ce70c1
commit 3827d5bc71
6 changed files with 21 additions and 25 deletions

View File

@@ -98,10 +98,8 @@ typedef struct {
bool input_isatty; // stdin is a terminal
bool output_isatty; // stdout is a terminal
bool err_isatty; // stderr is a terminal
bool headless; // Dont try to start an user interface
// or read/write to stdio(unless
// embedding)
int no_swap_file; /* "-n" argument used */
bool headless; // Do not start the builtin UI.
int no_swap_file; // "-n" argument used
int use_debug_break_level;
int window_count; /* number of windows to use */
int window_layout; /* 0, WIN_HOR, WIN_VER or WIN_TABS */
@@ -932,10 +930,11 @@ static void command_line_scan(mparm_T *parmp)
break;
case 's':
if (exmode_active) /* "-s" silent (batch) mode */
silent_mode = TRUE;
else /* "-s {scriptin}" read from script file */
want_argument = TRUE;
if (exmode_active) { // "-es" silent (batch) mode
silent_mode = true;
} else { // "-s {scriptin}" read from script file
want_argument = true;
}
break;
case 't': /* "-t {tag}" or "-t{tag}" jump to tag */