mirror of
https://github.com/raimon49/requirements.txt.vim.git
synced 2025-12-06 10:04:23 +08:00
Set makeprg if pip-compile is available
also update tests and make Requirements_matched_filename more specific.
This commit is contained in:
@@ -34,15 +34,16 @@ function! s:isRequirementsFile()
|
||||
endfunction
|
||||
|
||||
function! Requirements_matched_filename(filename)
|
||||
if a:filename =~# '\v.*require(ment)?s\.(txt|in)$'
|
||||
if fnamemodify(a:filename, ":t") =~# '\vrequire(ment)?s.*\.(txt|in)$'
|
||||
return 1
|
||||
endif
|
||||
|
||||
if a:filename =~# '\vrequire(ment)?s/.*\.(txt|in)$'
|
||||
if fnamemodify(fnamemodify(a:filename, ":h"), ":t") =~# '\v^require(ment)?s$'
|
||||
\ && fnamemodify(a:filename, ":e") =~# '\v^(txt|in)$'
|
||||
return 1
|
||||
endif
|
||||
|
||||
if a:filename =~# '\vconstraints\.(txt|in)$'
|
||||
if fnamemodify(a:filename, ":t") =~# '\v^constraints\.(txt|in)$'
|
||||
return 1
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user