Commit: patch 9.1.1935: filetype: not all Erlang files are recognized

2 views
Skip to first unread message

Christian Brabandt

unread,
Nov 30, 2025, 9:30:38 AM (10 days ago) Nov 30
to vim...@googlegroups.com
patch 9.1.1935: filetype: not all Erlang files are recognized

Commit: https://github.com/vim/vim/commit/2b2580e61a853617173f907bd42e12a073cf2410
Author: Jon Parise <j...@indelible.org>
Date: Sun Nov 30 10:02:45 2025 +0000

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 <j...@indelible.org>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index f05b6912b..df377dd69 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 <https://github.com/vim/vim>
-# Last Change: 2025 Nov 28
+# Last Change: 2025 Nov 30
# Former Maintainer: Bram Moolenaar <Br...@vim.org>

# 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 9fea9fa97..c733be61f 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 f98ecb3ed..0fef5ffe9 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -275,7 +275,7 @@ def s:GetFilenameChecks(): dict<list<string>>
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 1d10f93e6..7a796a89c 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,
/**/
Reply all
Reply to author
Forward
0 new messages