]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.2179: no filetype detection for execline scripts v9.0.2179
authorMazunki Hoksaas <rolferen@gmail.com>
Tue, 19 Dec 2023 19:44:41 +0000 (20:44 +0100)
committerChristian Brabandt <cb@256bit.org>
Tue, 19 Dec 2023 19:44:41 +0000 (20:44 +0100)
Problem:  no filetype detection for execline scripts
Solution: Add filetype detection for execline

as a prior to adding syntax support for execline (see
https://github.com/djpohly/vim-execline/issues/2), i went ahead and made
the filetype detection for execline scripts.

closes: #13689

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

index 1685093d54e22ce8331e34f34309c86088b7d6e3..f58899af316b8660511f64c7e82022e65104eea0 100644 (file)
@@ -225,6 +225,10 @@ export def Exe2filetype(name: string, line1: string): string
   elseif name =~ '^dart\>'
     return 'dart'
 
+    # Execline (s6)
+  elseif name =~ '^execlineb\>'
+    return 'execline'
+
   endif
 
   return ''
index 4043eb428e888573a8079a3744cbc8c9b3b567eb..30f8a1e16deb3620b8bbb4dd03d1fd069d6da965 100644 (file)
@@ -497,6 +497,10 @@ if has("fname_case")
    au BufNewFile,BufRead *.EU,*.EW,*.EX,*.EXU,*.EXW  call dist#ft#EuphoriaCheck()
 endif
 
+" Execline (s6) scripts
+au BufNewFile,BufRead *s6*/\(up\|down\|run\|finish\)    setf execline
+au BufNewFile,BufRead s6-*                              setf execline
+
 " Lynx config files
 au BufNewFile,BufRead lynx.cfg                 setf lynx
 
index f51cd719fb98cf00fdafa6a30e353f400eb14dae..fe22069a53fecb6f78a16c9f729bedc1732b4838 100644 (file)
@@ -236,6 +236,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     esqlc: ['file.ec', 'file.EC'],
     esterel: ['file.strl'],
     eterm: ['anyEterm/file.cfg', 'Eterm/file.cfg', 'some-Eterm/file.cfg'],
+    execline: ['/etc/s6-rc/run', './s6-rc/src/dbus-srv/up', '/sbin/s6-shutdown'],
     exim: ['exim.conf'],
     expect: ['file.exp'],
     exports: ['exports'],
@@ -915,6 +916,7 @@ def s:GetScriptChecks(): dict<list<list<string>>>
             ['#!/path/itclsh'],
             ['#!/path/itkwish']],
     expect: [['#!/path/expect']],
+    execline: [['#!/sbin/execlineb -S0'], ['#!/usr/bin/execlineb']],
     gnuplot: [['#!/path/gnuplot']],
     make:   [['#!/path/make']],
     nix:    [['#!/path/nix-shell']],
@@ -970,6 +972,7 @@ def s:GetScriptEnvChecks(): dict<list<list<string>>>
     perl: [['#!/usr/bin/env VAR=val perl']],
     scala: [['#!/usr/bin/env VAR=val VVAR=vval scala']],
     awk: [['#!/usr/bin/env VAR=val -i awk']],
+    execline: [['#!/usr/bin/env execlineb']],
     scheme: [['#!/usr/bin/env VAR=val --ignore-environment scheme']],
     python: [['#!/usr/bin/env VAR=val -S python -w -T']],
     wml: [['#!/usr/bin/env VAR=val --split-string wml']],
index 498c346a991676fc0a45e59af6139592a35ae5c7..89b224eaa3c0affeba4f33140cf08c4e1f02354b 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2179,
 /**/
     2178,
 /**/