mirror of
https://github.com/neovim/neovim.git
synced 2026-02-07 04:17:22 +00:00
Merge pull request #34239 from e-kwsm/vim-9.1.1342
vim-patch:9.1.{1342,1420}
This commit is contained in:
@@ -1959,11 +1959,10 @@ local function match_from_hashbang(contents, path, dispatch_extension)
|
||||
-- "#!/usr/bin/bash" to make matching easier.
|
||||
-- Recognize only a few {options} that are commonly used.
|
||||
if matchregex(first_line, [[^#!\s*\S*\<env\s]]) then
|
||||
first_line = first_line:gsub('%S+=%S+', '')
|
||||
first_line = first_line
|
||||
:gsub('%-%-ignore%-environment', '', 1)
|
||||
:gsub('%-%-split%-string', '', 1)
|
||||
:gsub('%-[iS]', '', 1)
|
||||
first_line = fn.substitute(first_line, [[\s\zs--split-string\(\s\|=\)]], '', '')
|
||||
first_line = fn.substitute(first_line, [[\s\zs[A-Za-z0-9_]\+=\S*\ze\s]], '', 'g')
|
||||
first_line =
|
||||
fn.substitute(first_line, [[\s\zs\%(-[iS]\+\|--ignore-environment\)\ze\s]], '', 'g')
|
||||
first_line = fn.substitute(first_line, [[\<env\s\+]], '', '')
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user