summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorСтрахиња Радић <contact@strahinja.org>2023-02-17 22:12:10 +0100
committerСтрахиња Радић <contact@strahinja.org>2023-02-17 22:12:10 +0100
commitff13f195f2cebb660eabc9926ef42faa50713874 (patch)
tree4284e316b11ad96241a2230be55ed239125744a5
parent2b3b91d1f615af0a6c8b47e41383a6d3af87060d (diff)
src/main.c: Make passing a file on command line consistent with :load with regards to loading configuration
Signed-off-by: Страхиња Радић <contact@strahinja.org>
-rw-r--r--src/main.c18
1 files 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();