summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-04 19:00:32 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-04 19:00:32 +0200
commit3e54569b17683318e0cb6693ab0024c2ad1e3e8f (patch)
tree53920e6f30fd8390d9232bd7062959c802d6ba64 /src/ex_docmd.c
parentce876aaa9a250a5a0d0e34b3a2625e51cf9bf5bb (diff)
patch 8.0.0613: the conf filetype is used before ftdetect from packagesv8.0.0613
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)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 13d5fe495e..2c9c8782e7 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -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