]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1807: runtime: crystal scripts not recognised v9.0.1807
authorDoug Kearns <dougkearns@gmail.com>
Sun, 27 Aug 2023 17:51:37 +0000 (19:51 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 27 Aug 2023 17:51:37 +0000 (19:51 +0200)
Problem:  runtime: crystal scripts not recognised
Solution: Filetype detect Crystal scripts by shebang line

closes: #12935

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

index 5f3ae4aeccbdf7d58e37622741316187da4b4545..6163003aa4414f8f4127e1aa167a6d9bae32e8af 100644 (file)
@@ -209,6 +209,10 @@ export def Exe2filetype(name: string, line1: string): string
   elseif name =~ 'nix-shell'
     return 'nix'
 
+    # Crystal
+  elseif name =~ '^crystal\>'
+    return 'crystal'
+
   endif
 
   return ''
index 0bd6453be76e0eeba587e1137a1935821f1ae9f9..aff66d89b1c90bfb652719dbc42246dcb50f8830 100644 (file)
@@ -944,6 +944,7 @@ def s:GetScriptChecks(): dict<list<list<string>>>
     fish:   [['#!/path/fish']],
     forth:  [['#!/path/gforth']],
     icon:   [['#!/path/icon']],
+    crystal: [['#!/path/crystal']],
   }
 enddef
 
index 0d647ec3f7f706107ba5b9774b03358722bd91e1..5b5fdb63d0747a4e48407f1175805c9c898d9fb4 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1807,
 /**/
     1806,
 /**/