vim-patch:9.0.1632: not all cabal config files are recognized (#24025)

Problem:    Not all cabal config files are recognized.
Solution:   Add a couple of patterns. (Marcin Szamotulski, closes vim/vim#12463)

166cd7b801

Also:
- Do not expand Lua patterns in environment variables used in file patterns.
- Test $XDG_CONFIG_HOME on Windows, as it can be used by Nvim (and the runner
  sets it).

Co-authored-by: Marcin Szamotulski <coot@coot.me>
This commit is contained in:
Jonas Strittmatter
2023-06-26 12:19:13 +02:00
committed by GitHub
parent 7578144cbd
commit 0ca2d11c1f
2 changed files with 42 additions and 7 deletions

View File

@@ -1809,6 +1809,8 @@ local pattern = {
['bzr_log%..*'] = 'bzr',
['.*enlightenment/.*%.cfg'] = 'c',
['${HOME}/cabal%.config'] = 'cabalconfig',
['${HOME}/%.config/cabal/config'] = 'cabalconfig',
['${XDG_CONFIG_HOME}/cabal/config'] = 'cabalconfig',
['cabal%.project%..*'] = starsetf('cabalproject'),
['.*/%.calendar/.*'] = starsetf('calendar'),
['.*/share/calendar/.*/calendar%..*'] = starsetf('calendar'),
@@ -2490,7 +2492,7 @@ local function match_pattern(name, path, tail, pat)
return_early = true
return nil
end
return vim.env[env]
return vim.pesc(vim.env[env])
end)
if return_early then
return false