diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2025-06-01 08:31:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-01 08:31:00 +0800 |
| commit | 7a8b0cd0f85ad2b488e943ecbcd085f1fbccf020 (patch) | |
| tree | 6b95389a7439a4872db5b37e1045ae337ab5bcf3 /runtime/lua | |
| parent | f72c13341afb3e2459202d3f6e57cd00614c2ab5 (diff) | |
| parent | 0471cc75954d23e15f5ce5d11937a00eb34bac11 (diff) | |
| download | rneovim-7a8b0cd0f85ad2b488e943ecbcd085f1fbccf020.tar.gz rneovim-7a8b0cd0f85ad2b488e943ecbcd085f1fbccf020.tar.bz2 rneovim-7a8b0cd0f85ad2b488e943ecbcd085f1fbccf020.zip | |
Merge pull request #34239 from e-kwsm/vim-9.1.1342
vim-patch:9.1.{1342,1420}
Diffstat (limited to 'runtime/lua')
| -rw-r--r-- | runtime/lua/vim/filetype/detect.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua index 6e1f833424..c78945ef04 100644 --- a/runtime/lua/vim/filetype/detect.lua +++ b/runtime/lua/vim/filetype/detect.lua @@ -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 |