From ed1a9c310df178e1163c910f70b194a657ad055a Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Tue, 1 Mar 2022 10:47:20 -0700 Subject: [PATCH] fix: enable filetype detection and syntax highlighting with --clean (#17566) --clean is supposed to emulate a "fresh install" and since Neovim enables filetype detection and syntax highlighting by default, these should be enabled when using --clean as well. --- src/nvim/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/main.c b/src/nvim/main.c index b02ebbe030..d0b3a435c3 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -357,7 +357,7 @@ int main(int argc, char **argv) // Execute --cmd arguments. exe_pre_commands(¶ms); - if (!vimrc_none) { + if (!vimrc_none || params.clean) { // Sources ftplugin.vim and indent.vim. We do this *before* the user startup scripts to ensure // ftplugins run before FileType autocommands defined in the init file (which allows those // autocommands to overwrite settings from ftplugins). @@ -368,7 +368,7 @@ int main(int argc, char **argv) source_startup_scripts(¶ms); // If using the runtime (-u is not NONE), enable syntax & filetype plugins. - if (!vimrc_none) { + if (!vimrc_none || params.clean) { // Sources filetype.lua and filetype.vim unless the user explicitly disabled it with :filetype // off. filetype_maybe_enable();