diff options
author | Christian Brabandt <cb@256bit.org> | 2021-05-29 19:53:50 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-05-29 19:53:50 +0200 |
commit | 1d3a14ecf0cdde026984894c592dc140a2b46887 (patch) | |
tree | 61f1f20638e52bd684584205a7f2cdbf20a1a286 /src/main.c | |
parent | 74ede80aeb272ac81d41a256057c4f250372dd00 (diff) |
patch 8.2.2905: no error when defaults.vim cannot be loadedv8.2.2905
Problem: No error when defaults.vim cannot be loaded.
Solution: Add an error message. (Christian Brabandt, closes #8248)
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c index 277e31790b..db8202ea7d 100644 --- a/src/main.c +++ b/src/main.c @@ -3128,7 +3128,11 @@ source_startup_scripts(mparm_T *parmp) if (parmp->use_vimrc != NULL) { if (STRCMP(parmp->use_vimrc, "DEFAULTS") == 0) - do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE, NULL); + { + if (do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE, NULL) + != OK) + emsg(e_failed_to_source_defaults); + } else if (STRCMP(parmp->use_vimrc, "NONE") == 0 || STRCMP(parmp->use_vimrc, "NORC") == 0) { @@ -3200,7 +3204,9 @@ source_startup_scripts(mparm_T *parmp) && !has_dash_c_arg) { // When no .vimrc file was found: source defaults.vim. - do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE, NULL); + if (do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE, + NULL) == FAIL) + emsg(e_failed_to_source_defaults); } } |