Mercurial > vim
comparison src/ex_docmd.c @ 11459:561b76ed9d12 v8.0.0613
patch 8.0.0613: the conf filetype is used before ftdetect from packages
commit https://github.com/vim/vim/commit/3e54569b17683318e0cb6693ab0024c2ad1e3e8f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 4 19:00:32 2017 +0200
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 04 Jun 2017 19:15:03 +0200 |
parents | 346168f2a6cb |
children | 6fff8b86e9bd |
comparison
equal
deleted
inserted
replaced
11458:8322abc9fced | 11459:561b76ed9d12 |
---|---|
12170 else | 12170 else |
12171 EMSG2(_(e_invarg2), arg); | 12171 EMSG2(_(e_invarg2), arg); |
12172 } | 12172 } |
12173 | 12173 |
12174 /* | 12174 /* |
12175 * ":setfiletype {name}" | 12175 * ":setfiletype [FALLBACK] {name}" |
12176 */ | 12176 */ |
12177 static void | 12177 static void |
12178 ex_setfiletype(exarg_T *eap) | 12178 ex_setfiletype(exarg_T *eap) |
12179 { | 12179 { |
12180 if (!did_filetype) | 12180 if (!did_filetype) |
12181 set_option_value((char_u *)"filetype", 0L, eap->arg, OPT_LOCAL); | 12181 { |
12182 char_u *arg = eap->arg; | |
12183 | |
12184 if (STRNCMP(arg, "FALLBACK ", 9) == 0) | |
12185 arg += 9; | |
12186 | |
12187 set_option_value((char_u *)"filetype", 0L, arg, OPT_LOCAL); | |
12188 if (arg != eap->arg) | |
12189 did_filetype = FALSE; | |
12190 } | |
12182 } | 12191 } |
12183 #endif | 12192 #endif |
12184 | 12193 |
12185 static void | 12194 static void |
12186 ex_digraphs(exarg_T *eap UNUSED) | 12195 ex_digraphs(exarg_T *eap UNUSED) |