From ff13f195f2cebb660eabc9926ef42faa50713874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D1=80=D0=B0=D1=85=D0=B8=D1=9A=D0=B0=20=D0=A0?= =?UTF-8?q?=D0=B0=D0=B4=D0=B8=D1=9B?= Date: Fri, 17 Feb 2023 22:12:10 +0100 Subject: src/main.c: Make passing a file on command line consistent with :load with regards to loading configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Страхиња Радић --- src/main.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main.c b/src/main.c index 8e362e7..a1ec809 100644 --- a/src/main.c +++ b/src/main.c @@ -267,16 +267,7 @@ int main (int argc, char ** argv) { * readfile_argv(argc, argv); */ - /* load file passed as argv to sc-im. - * if more than one file is passed, consider the last one. - */ - load_file(strlen(loadingfile) ? loadingfile : NULL); - - /* - * check if session->cur_doc is NULL (no file passed as argv). - * if so, create an empty doc with just one sheet - */ - if (session->cur_doc == NULL) create_empty_wb(); + create_empty_wb(); /* * load_rc. Since we are not sure what people put it their scimrc file, @@ -285,6 +276,13 @@ int main (int argc, char ** argv) { */ load_rc(); + /* load file passed as argv to sc-im. + * if more than one file is passed, consider the last one. + */ + if (strlen(loadingfile)) + load_file(loadingfile); + + // check input from stdin (pipeline) // and send it to interp read_stdin(); -- cgit v1.2.3 From 6e85f75b99f34e167bca3456c0c8c224cf5af0c7 Mon Sep 17 00:00:00 2001 From: mongo Date: Thu, 1 Jun 2023 10:28:36 -0300 Subject: added comment --- src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index a1ec809..e83dad3 100644 --- a/src/main.c +++ b/src/main.c @@ -270,9 +270,10 @@ int main (int argc, char ** argv) { create_empty_wb(); /* - * load_rc. Since we are not sure what people put it their scimrc file, + * load_rc. Since we are not sure what people put in their scimrc file, * other than configuration variables and mappings, * we call the load_rc() routine after session / roman / sheet are alloc'ed. + * See entire 778 issue and 783 PR for details on why this order is set. */ load_rc(); -- cgit v1.2.3