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.
This commit is contained in:
Gregory Anders 2022-03-01 10:47:20 -07:00 committed by GitHub
parent 770b9f3c3b
commit ed1a9c310d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -357,7 +357,7 @@ int main(int argc, char **argv)
// Execute --cmd arguments. // Execute --cmd arguments.
exe_pre_commands(&params); exe_pre_commands(&params);
if (!vimrc_none) { if (!vimrc_none || params.clean) {
// Sources ftplugin.vim and indent.vim. We do this *before* the user startup scripts to ensure // 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 // ftplugins run before FileType autocommands defined in the init file (which allows those
// autocommands to overwrite settings from ftplugins). // autocommands to overwrite settings from ftplugins).
@ -368,7 +368,7 @@ int main(int argc, char **argv)
source_startup_scripts(&params); source_startup_scripts(&params);
// If using the runtime (-u is not NONE), enable syntax & filetype plugins. // 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 // Sources filetype.lua and filetype.vim unless the user explicitly disabled it with :filetype
// off. // off.
filetype_maybe_enable(); filetype_maybe_enable();