aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index d6976bcb8f..0387bd1ad7 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -9299,6 +9299,24 @@ static void ex_filetype(exarg_T *eap)
EMSG2(_(e_invarg2), arg);
}
+/// Same as :filetype plugin indent enable
+/// Updates the state used for :filetype without args.
+void force_enable_filetype(void)
+{
+ if (!filetype_detect) {
+ source_runtime((char_u *)FILETYPE_FILE, true);
+ filetype_detect = true;
+ }
+ if (!filetype_plugin) {
+ source_runtime((char_u *)FTPLUGIN_FILE, true);
+ filetype_plugin = true;
+ }
+ if (!filetype_indent) {
+ source_runtime((char_u *)INDENT_FILE, true);
+ filetype_indent = true;
+ }
+}
+
/*
* ":setfiletype {name}"
*/