0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.0.0613: the conf filetype is used before ftdetect from packages

Problem:    The conf filetype detection is done before ftdetect scripts from
            packages that are added later.
Solution:   Add the FALLBACK argument to :setfiletype. (closes #1679,
            closes #1693)
This commit is contained in:
Bram Moolenaar
2017-06-04 19:00:32 +02:00
parent ce876aaa9a
commit 3e54569b17
6 changed files with 84 additions and 9 deletions

View File

@@ -12172,13 +12172,22 @@ ex_filetype(exarg_T *eap)
}
/*
* ":setfiletype {name}"
* ":setfiletype [FALLBACK] {name}"
*/
static void
ex_setfiletype(exarg_T *eap)
{
if (!did_filetype)
set_option_value((char_u *)"filetype", 0L, eap->arg, OPT_LOCAL);
{
char_u *arg = eap->arg;
if (STRNCMP(arg, "FALLBACK ", 9) == 0)
arg += 9;
set_option_value((char_u *)"filetype", 0L, arg, OPT_LOCAL);
if (arg != eap->arg)
did_filetype = FALSE;
}
}
#endif