]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1935: filetype: not all Erlang files are recognized v9.1.1935
authorJon Parise <jon@indelible.org>
Sun, 30 Nov 2025 10:02:45 +0000 (10:02 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 30 Nov 2025 10:02:45 +0000 (10:02 +0000)
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 <jon@indelible.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/dist/ft.vim
runtime/filetype.vim
src/testdir/test_filetype.vim
src/version.c

index f05b6912b32724ece8c094c53d1cf3ebfc0d0c07..df377dd6952519daf48ddd3e26ed5f6465b076ba 100644 (file)
@@ -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 <Bram@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
index 9fea9fa97b08ba42e4683e50f803df3fb1f9ffd8..c733be61fc72a856d08f565bbbc782c07f1331b6 100644 (file)
@@ -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
 
index f98ecb3ed895e6eaa1ee665751851a12ee7e4035..0fef5ffe9d09d0fa7d1ea63cac502e3e03bce3e8 100644 (file)
@@ -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'],
index 1d10f93e6c3e6d37431173cc57e871417a3c2367..7a796a89cd4837500e8310791b95168d7b90278b 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1935,
 /**/
     1934,
 /**/