diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-11-28 16:08:34 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2020-11-28 16:55:06 +0100 |
commit | b8ec6a577591f41f9011c4b797afdfbf7dda0bff (patch) | |
tree | 14299ab517a257d4c12bd390e9f4fd225a00b7e3 | |
parent | ba13b94f5aab734bdb242d515ac43d973ba6c6c5 (diff) | |
download | rneovim-b8ec6a577591f41f9011c4b797afdfbf7dda0bff.tar.gz rneovim-b8ec6a577591f41f9011c4b797afdfbf7dda0bff.tar.bz2 rneovim-b8ec6a577591f41f9011c4b797afdfbf7dda0bff.zip |
initialization: delay logging in set_init_1()
-rw-r--r-- | src/nvim/option.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 77a13b16b1..0034117ddc 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -342,6 +342,10 @@ static char_u SHM_ALL[] = { /// /// Called only once from main(), just after creating the first buffer. /// If "clean_arg" is true, Nvim was started with --clean. +/// +/// NOTE: ELOG() etc calls are not allowed here, as log location depends on +/// env var expansion which depends on expression evaluation and other +/// editor state initialized here. Do logging in set_init_2 or later. void set_init_1(bool clean_arg) { int opt_idx; @@ -494,7 +498,6 @@ void set_init_1(bool clean_arg) // this function. char *rtp = runtimepath_default(clean_arg); if (rtp) { - ILOG("startup runtimepart/packpath value: %s", rtp); set_string_default("runtimepath", rtp, true); // Make a copy of 'rtp' for 'packpath' set_string_default("packpath", rtp, false); @@ -751,6 +754,9 @@ void free_all_options(void) /// Initialize the options, part two: After getting Rows and Columns. void set_init_2(bool headless) { + // set in set_init_1 but logging is not allowed there + ILOG("startup runtimepath/packpath value: %s", p_rtp); + int idx; // 'scroll' defaults to half the window height. The stored default is zero, |