diff options
| author | Matthieu Coudron <mattator@gmail.com> | 2020-06-22 22:40:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-22 22:40:33 +0200 |
| commit | 8f30753aa1398eadecf1bd9f6dc71251218b9b2d (patch) | |
| tree | 9572999548caca5b79f2c028e88a5cbc1db97319 /runtime/scripts.vim | |
| parent | 21453e8f09b72751d396858b9ea86c0584fd6c89 (diff) | |
| parent | b198225361dd87161c494627dfebb3d9ffd6cf5a (diff) | |
| download | rneovim-8f30753aa1398eadecf1bd9f6dc71251218b9b2d.tar.gz rneovim-8f30753aa1398eadecf1bd9f6dc71251218b9b2d.tar.bz2 rneovim-8f30753aa1398eadecf1bd9f6dc71251218b9b2d.zip | |
Merge pull request #12455 from janlazo/vim-8.0.1554
[RDY]vim-patch:8.0.1554,8.1.1977,8.2.{927,930,932,938,954,963,964,966,980,983,998,999}
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 |