commit ed1a9c310df178e1163c910f70b194a657ad055a
parent 770b9f3c3b2d236ea3e1a480a2b06a9b8846508f
Author: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Date: Tue, 1 Mar 2022 10:47:20 -0700
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.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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();