diff options
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r-- | src/nvim/main.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index bbe877356d..e26922bf8e 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -239,6 +239,14 @@ int main(int argc, char **argv) argv0 = argv[0]; + if (argc > 1 && STRICMP(argv[1], "-ll") == 0) { + if (argc == 2) { + print_mainerr(err_arg_missing, argv[1]); + exit(1); + } + nlua_run_script(argv, argc, 3); + } + char *fname = NULL; // file name from command line mparm_T params; // various parameters passed between // main() and other functions. @@ -803,6 +811,11 @@ void preserve_exit(void) really_exiting = true; // Ignore SIGHUP while we are already exiting. #9274 signal_reject_deadly(); + + if (ui_client_channel_id) { + os_exit(1); + } + os_errmsg(IObuff); os_errmsg("\n"); ui_flush(); @@ -2111,6 +2124,12 @@ static int execute_env(char *env) static void mainerr(const char *errstr, const char *str) FUNC_ATTR_NORETURN { + print_mainerr(errstr, str); + os_exit(1); +} + +static void print_mainerr(const char *errstr, const char *str) +{ char *prgname = path_tail(argv0); signal_stop(); // kill us with CTRL-C here, if you like @@ -2126,8 +2145,6 @@ static void mainerr(const char *errstr, const char *str) os_errmsg(_("\nMore info with \"")); os_errmsg(prgname); os_errmsg(" -h\"\n"); - - os_exit(1); } /// Prints version information for "nvim -v" or "nvim --version". |