changeset 35431:974133f9655a v9.1.0492

patch 9.1.0492: filetype: Vim-script files not detected by shebang line Commit: https://github.com/vim/vim/commit/0d4d23dac0a5a77ccb0ebf1dcf646afe0c6886bf Author: Doug Kearns <dougkearns@gmail.com> Date: Sun Jun 16 08:32:15 2024 +0200 patch 9.1.0492: filetype: Vim-script files not detected by shebang line 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>
author Christian Brabandt <cb@256bit.org>
date Sun, 16 Jun 2024 08:45:09 +0200
parents 30d1a3a62135
children 595487579635
files runtime/autoload/dist/script.vim src/testdir/test_filetype.vim src/version.c
diffstat 3 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/autoload/dist/script.vim
+++ b/runtime/autoload/dist/script.vim
@@ -229,6 +229,10 @@ export def Exe2filetype(name: string, li
   elseif name =~ '^execlineb\>'
     return 'execline'
 
+    # Vim
+  elseif name =~ '^vim\>'
+    return 'vim'
+
   endif
 
   return ''
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -994,6 +994,7 @@ def s:GetScriptChecks(): dict<list<list<
             ['#!/path/regina']],
     janet:  [['#!/path/janet']],
     dart:   [['#!/path/dart']],
+    vim:    [['#!/path/vim']],
   }
 enddef
 
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    492,
+/**/
     491,
 /**/
     490,