aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2022-01-04 07:28:29 -0700
committerGitHub <noreply@github.com>2022-01-04 07:28:29 -0700
commit3fd454bd4a6ceb1989d15cf2d3d5e11d7a253b2d (patch)
tree1718a362cf49adabd478fe16a6e35335681d8611 /src/nvim/ex_docmd.c
parentcc62f3d6cb639abffb1b0b6ce47a481bc67003d2 (diff)
downloadrneovim-3fd454bd4a6ceb1989d15cf2d3d5e11d7a253b2d.tar.gz
rneovim-3fd454bd4a6ceb1989d15cf2d3d5e11d7a253b2d.tar.bz2
rneovim-3fd454bd4a6ceb1989d15cf2d3d5e11d7a253b2d.zip
feat: filetype.lua (#16600)
Adds a new vim.filetype module that provides support for filetype detection in Lua.
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 0d82406a0a..71c34f98ff 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -9551,15 +9551,18 @@ static void ex_filetype(exarg_T *eap)
void filetype_maybe_enable(void)
{
if (filetype_detect == kNone) {
- source_runtime(FILETYPE_FILE, true);
+ // Normally .vim files are sourced before .lua files when both are
+ // supported, but we reverse the order here because we want the Lua
+ // autocommand to be defined first so that it runs first
+ source_runtime(FILETYPE_FILE, DIP_ALL);
filetype_detect = kTrue;
}
if (filetype_plugin == kNone) {
- source_runtime(FTPLUGIN_FILE, true);
+ source_runtime(FTPLUGIN_FILE, DIP_ALL);
filetype_plugin = kTrue;
}
if (filetype_indent == kNone) {
- source_runtime(INDENT_FILE, true);
+ source_runtime(INDENT_FILE, DIP_ALL);
filetype_indent = kTrue;
}
}