mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
vim-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 vim/vim#1679,
closes vim/vim#1693)
3e54569b17
This commit is contained in:
@@ -9743,13 +9743,20 @@ void filetype_maybe_enable(void)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ":setfiletype {name}"
|
||||
*/
|
||||
/// ":setfiletype [FALLBACK] {name}"
|
||||
static void ex_setfiletype(exarg_T *eap)
|
||||
{
|
||||
if (!did_filetype) {
|
||||
set_option_value("filetype", 0L, (char *)eap->arg, OPT_LOCAL);
|
||||
char_u *arg = eap->arg;
|
||||
|
||||
if (STRNCMP(arg, "FALLBACK ", 9) == 0) {
|
||||
arg += 9;
|
||||
}
|
||||
|
||||
set_option_value("filetype", 0L, (char *)arg, OPT_LOCAL);
|
||||
if (arg != eap->arg) {
|
||||
did_filetype = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user