]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0492: filetype: Vim-script files not detected by shebang line v9.1.0492
authorDoug Kearns <dougkearns@gmail.com>
Sun, 16 Jun 2024 06:32:15 +0000 (08:32 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 16 Jun 2024 06:32:15 +0000 (08:32 +0200)
Problem:  Vim-script files may not be recognised
Solution: Add shebang line detection (Doug Kearns)

closes: #15012

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/dist/script.vim
src/testdir/test_filetype.vim
src/version.c

index f58899af316b8660511f64c7e82022e65104eea0..33ed7fd2fcb8716039c5911fac1fe269513137a7 100644 (file)
@@ -229,6 +229,10 @@ export def Exe2filetype(name: string, line1: string): string
   elseif name =~ '^execlineb\>'
     return 'execline'
 
+    # Vim
+  elseif name =~ '^vim\>'
+    return 'vim'
+
   endif
 
   return ''
index c43eda78f21724a0875b3442ffbb4fa3d73b06dc..d0a078f73253e0ca4e9cb5fc6f0d9459a9f77816 100644 (file)
@@ -994,6 +994,7 @@ def s:GetScriptChecks(): dict<list<list<string>>>
             ['#!/path/regina']],
     janet:  [['#!/path/janet']],
     dart:   [['#!/path/dart']],
+    vim:    [['#!/path/vim']],
   }
 enddef
 
index 5f7ea4c4445e807efc793357e931899e6b6e3939..abfcf3f5683cafc6f9b9d9639bfb34e65afb97d5 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    492,
 /**/
     491,
 /**/