diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-06-07 18:56:28 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-06-18 18:01:42 -0400 |
commit | 9d565c5ba3866fd5e754daef26f2937ed8193836 (patch) | |
tree | df3bad1dd01c4d71f9d69a2b9230916723249351 /runtime/scripts.vim | |
parent | 150168b8814537c77fa005cee107b551718a7245 (diff) | |
download | rneovim-9d565c5ba3866fd5e754daef26f2937ed8193836.tar.gz rneovim-9d565c5ba3866fd5e754daef26f2937ed8193836.tar.bz2 rneovim-9d565c5ba3866fd5e754daef26f2937ed8193836.zip |
vim-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 vim/vim#5013)
Add tests.
https://github.com/vim/vim/commit/b5e18f29fac9253b0ccf1fde5e74bff72fa1ba60
Diffstat (limited to 'runtime/scripts.vim')
-rw-r--r-- | runtime/scripts.vim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/scripts.vim b/runtime/scripts.vim index c552f0202f..6aae2b1ec3 100644 --- a/runtime/scripts.vim +++ b/runtime/scripts.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types in scripts " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last change: 2019 Jun 25 +" 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*\<env\s' let s:line1 = substitute(s:line1, '\S\+=\S\+', '', 'g') + let s:line1 = substitute(s:line1, '\(-[iS]\|--ignore-environment\|--split-string\)', '', '') let s:line1 = substitute(s:line1, '\<env\s\+', '', '') endif |