From 2b2580e61a853617173f907bd42e12a073cf2410 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Sun, 30 Nov 2025 10:02:45 +0000 Subject: [PATCH] patch 9.1.1935: filetype: not all Erlang files are recognized Problem: filetype: not all Erlang files are recognized Solution: Detect *.app.src and rebar.config files as erlang filetype (John Parise). *.app.src files contain Erlang application definitions. (There are also *.app files, which are similar but more often build artifacts, and that file extension is too ambiguous to be recognized by default.) Reference: - https://www.erlang.org/doc/system/applications.html Rebar is the Erlang build tool. rebar.config uses Erlang syntax. Reference: - https://rebar3.org/docs/configuration/configuration/ closes: #18835 Signed-off-by: Jon Parise Signed-off-by: Christian Brabandt --- runtime/autoload/dist/ft.vim | 4 +++- runtime/filetype.vim | 3 +++ src/testdir/test_filetype.vim | 2 +- src/version.c | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index f05b6912b3..df377dd695 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -3,7 +3,7 @@ vim9script # Vim functions for file type detection # # Maintainer: The Vim Project -# Last Change: 2025 Nov 28 +# Last Change: 2025 Nov 30 # Former Maintainer: Bram Moolenaar # These functions are moved here from runtime/filetype.vim to make startup @@ -3072,6 +3072,8 @@ const ft_from_name = { ".editorconfig": "editorconfig", # Elinks configuration "elinks.conf": "elinks", + # Erlang + "rebar.config": "erlang", # Exim "exim.conf": "exim", # Exports diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 9fea9fa97b..c733be61fc 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -427,6 +427,9 @@ au BufNewFile,BufRead *.e,*.E call dist#ft#FTe() " Elm Filter Rules file au BufNewFile,BufRead filter-rules setf elmfilt +" Erlang +au BufNewFile,BufRead *.app.src setf erlang + " ESMTP rc file au BufNewFile,BufRead *esmtprc setf esmtprc diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index f98ecb3ed8..0fef5ffe9d 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -275,7 +275,7 @@ def s:GetFilenameChecks(): dict> elsa: ['file.lc'], elvish: ['file.elv'], epuppet: ['file.epp'], - erlang: ['file.erl', 'file.hrl', 'file.yaws'], + erlang: ['file.erl', 'file.hrl', 'file.yaws', 'file.app.src', 'rebar.config'], eruby: ['file.erb', 'file.rhtml'], esdl: ['file.esdl'], esmtprc: ['anyesmtprc', 'esmtprc', 'some-esmtprc'], diff --git a/src/version.c b/src/version.c index 1d10f93e6c..7a796a89cd 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1935, /**/ 1934, /**/ -- 2.47.3