# HG changeset patch # User Bram Moolenaar # Date 1591560004 -7200 # Node ID 33a14786a0e41008f3ed4720970b2894d3ca934c # Parent c3f999111bfd288a68d49052e2cddbb1dc2526d1 patch 8.2.0930: script filetype detection trips over env -S argument Commit: https://github.com/vim/vim/commit/b5e18f29fac9253b0ccf1fde5e74bff72fa1ba60 Author: Bram Moolenaar Date: Sun Jun 7 21:58:54 2020 +0200 patch 8.2.0930: script filetype detection trips over env -S argument Problem: Script filetype detection trips over env -S argument. Solution: Remove "-S" and "--ignore-environment". (closes https://github.com/vim/vim/issues/5013) Add tests. diff --git a/runtime/scripts.vim b/runtime/scripts.vim --- a/runtime/scripts.vim +++ b/runtime/scripts.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types in scripts " " Maintainer: Bram Moolenaar -" Last change: 2020 Mar 06 +" Last change: 2020 Jun 07 " This file is called by an autocommand for every file that has just been " loaded into a buffer. It checks if the type of file can be recognized by @@ -35,10 +35,12 @@ let s:line1 = getline(1) if s:line1 =~# "^#!" " A script that starts with "#!". - " Check for a line like "#!/usr/bin/env VAR=val bash". Turn it into + " Check for a line like "#!/usr/bin/env {options} bash". Turn it into " "#!/usr/bin/bash" to make matching easier. + " Recognize only a few {options} that are commonly used. if s:line1 =~# '^#!\s*\S*\\\"\", 'tx') call assert_equal('"setfiletype java javacc javascript javascriptreact', @:) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 930, +/**/ 929, /**/ 928,