mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
fix(messages): 'exrc' / secure messages
This commit is contained in:
@@ -121,16 +121,20 @@ function M.read(path)
|
||||
return contents
|
||||
end
|
||||
|
||||
local dir_msg = ' To enable it, choose (v)iew then run `:trust`.'
|
||||
local msg2 = ' To enable it, choose (v)iew then run `:trust`:'
|
||||
local choices = '&ignore\n&view\n&deny'
|
||||
if hash == 'directory' then
|
||||
dir_msg = ' DIRECTORY trust is decided only by its name, not its contents.'
|
||||
msg2 = ' DIRECTORY trust is decided only by name, not contents:'
|
||||
choices = '&ignore\n&view\n&deny\n&allow'
|
||||
end
|
||||
|
||||
-- File either does not exist in trust database or the hash does not match
|
||||
local ok, result =
|
||||
pcall(vim.fn.confirm, string.format('%s is not trusted.%s', fullpath, dir_msg), choices, 1)
|
||||
local ok, result = pcall(
|
||||
vim.fn.confirm,
|
||||
string.format('exrc: Found untrusted code.%s\n%s', msg2, fullpath),
|
||||
choices,
|
||||
1
|
||||
)
|
||||
|
||||
if not ok and result ~= 'Keyboard interrupt' then
|
||||
error(result)
|
||||
|
||||
Reference in New Issue
Block a user