mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 08:48:16 +00:00
syntax: don't override user settings
This commit is contained in:

committed by
Justin M. Keyes

parent
cae0904160
commit
9c2c24ec48
@@ -9299,19 +9299,15 @@ static void ex_filetype(exarg_T *eap)
|
|||||||
EMSG2(_(e_invarg2), arg);
|
EMSG2(_(e_invarg2), arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Same as :filetype plugin indent enable
|
/// Do ":filetype plugin indent on" if user did not already do some
|
||||||
/// Updates the state used for :filetype without args.
|
/// permutation thereof.
|
||||||
void force_enable_filetype(void)
|
void force_enable_filetype(void)
|
||||||
{
|
{
|
||||||
if (!filetype_detect) {
|
if (!filetype_detect && !filetype_plugin && !filetype_indent) {
|
||||||
source_runtime((char_u *)FILETYPE_FILE, true);
|
source_runtime((char_u *)FILETYPE_FILE, true);
|
||||||
filetype_detect = true;
|
filetype_detect = true;
|
||||||
}
|
|
||||||
if (!filetype_plugin) {
|
|
||||||
source_runtime((char_u *)FTPLUGIN_FILE, true);
|
source_runtime((char_u *)FTPLUGIN_FILE, true);
|
||||||
filetype_plugin = true;
|
filetype_plugin = true;
|
||||||
}
|
|
||||||
if (!filetype_indent) {
|
|
||||||
source_runtime((char_u *)INDENT_FILE, true);
|
source_runtime((char_u *)INDENT_FILE, true);
|
||||||
filetype_indent = true;
|
filetype_indent = true;
|
||||||
}
|
}
|
||||||
|
@@ -332,12 +332,12 @@ int main(int argc, char **argv)
|
|||||||
/* Source startup scripts. */
|
/* Source startup scripts. */
|
||||||
source_startup_scripts(¶ms);
|
source_startup_scripts(¶ms);
|
||||||
|
|
||||||
// If using the runtime (-u is not NONE), enable syntax and filetype plugins
|
// If using the runtime (-u is not NONE), enable syntax & filetype plugins.
|
||||||
if (params.use_vimrc != NULL && strcmp(params.use_vimrc, "NONE") != 0) {
|
if (params.use_vimrc != NULL && strcmp(params.use_vimrc, "NONE") != 0) {
|
||||||
// Do this before syntax/syntax.vim (which calls `:filetype on`).
|
// Do ":filetype plugin indent on".
|
||||||
force_enable_filetype();
|
force_enable_filetype();
|
||||||
// Enable syntax highlighting.
|
// Enable syntax (sources syntax/syntax.vim, which calls `:filetype on`).
|
||||||
syn_cmd("syntax"); // sources syntax/syntax.vim
|
syn_cmd("syntax");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user