mirror of
https://github.com/neovim/neovim.git
synced 2026-03-28 19:32:01 +00:00
feat(secure): allow 'path' parameter for trust action 'allow' (#38001)
This commit is contained in:
@@ -168,7 +168,6 @@ end
|
||||
--- @field action 'allow'|'deny'|'remove'
|
||||
---
|
||||
--- Path to a file to update. Mutually exclusive with {bufnr}.
|
||||
--- Cannot be used when {action} is "allow".
|
||||
--- @field path? string
|
||||
--- Buffer number to update. Mutually exclusive with {path}.
|
||||
--- @field bufnr? integer
|
||||
@@ -195,10 +194,6 @@ function M.trust(opts)
|
||||
|
||||
assert(not path or not bufnr, '"path" and "bufnr" are mutually exclusive')
|
||||
|
||||
if action == 'allow' then
|
||||
assert(not path, '"path" is not valid when action is "allow"')
|
||||
end
|
||||
|
||||
local fullpath ---@type string?
|
||||
if path then
|
||||
fullpath = vim.uv.fs_realpath(vim.fs.normalize(path))
|
||||
|
||||
Reference in New Issue
Block a user