aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/main.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index cf9cb9cfbd..95cb53df43 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -366,19 +366,16 @@ int main(int argc, char **argv)
// Execute --cmd arguments.
exe_pre_commands(&params);
- // If using the runtime (-u is not NONE), enable syntax & filetype plugins.
- bool enable_syntax =
- (params.use_vimrc == NULL || !strequal(params.use_vimrc, "NONE"));
-
- // Source syncolor.vim to set up default UI highlights
- if (enable_syntax) {
- source_runtime((char_u *)"syntax/syncolor.vim", DIP_ALL);
- }
-
// Source startup scripts.
source_startup_scripts(&params);
- if (enable_syntax) {
+ // If using the runtime (-u is not NONE), enable syntax & filetype plugins.
+ if (params.use_vimrc == NULL || !strequal(params.use_vimrc, "NONE")) {
+ // Source syncolor.vim to set up default UI highlights if the user didn't
+ // already enable a colorscheme
+ if (!get_var_value("g:colors_name")) {
+ source_runtime((char_u *)"syntax/syncolor.vim", DIP_ALL);
+ }
// Does ":filetype plugin indent on".
filetype_maybe_enable();
// Sources syntax/syntax.vim, which calls `:filetype on`.