Fix: notification fix.

This commit is contained in:
psychhim
2025-11-02 22:53:00 +05:30
parent d7308c955a
commit 74e40cc7ae

View File

@@ -142,7 +142,7 @@ local function write_with_sudo(filename, content)
if not sudo_password_cache then if not sudo_password_cache then
local pass = vim.fn.inputsecret '[sudo] password: ' local pass = vim.fn.inputsecret '[sudo] password: '
if pass == '' or pass == nil then if pass == '' or pass == nil then
vim.notify('Password is required, Save cancelled', vim.log.levels.WARN) vim.notify('Save cancelled', vim.log.levels.WARN)
return false return false
end end
sudo_password_cache = pass sudo_password_cache = pass
@@ -179,7 +179,7 @@ local function smart_save(force_save_as)
-- Ask user for filename -- Ask user for filename
filename = vim.fn.input('Save as: ', default_input, 'file') filename = vim.fn.input('Save as: ', default_input, 'file')
if filename == '' then if filename == '' then
vim.notify('Password is required, Save cancelled', vim.log.levels.WARN) vim.notify('Save cancelled', vim.log.levels.WARN)
return return
end end
-- Check if file already exists -- Check if file already exists
@@ -404,7 +404,7 @@ local function close_window(mode)
-- Ask user for filename -- Ask user for filename
local input_name = vim.fn.input('Save as: ', '', 'file') local input_name = vim.fn.input('Save as: ', '', 'file')
if input_name == '' then if input_name == '' then
vim.notify('Password is required, Save cancelled', vim.log.levels.WARN) vim.notify('Save cancelled', vim.log.levels.WARN)
return false return false
end end
vim.api.nvim_buf_set_name(bufnr, input_name) vim.api.nvim_buf_set_name(bufnr, input_name)
@@ -439,7 +439,7 @@ local function close_window(mode)
if save_file() then if save_file() then
toggle_undotree_twice(callback) toggle_undotree_twice(callback)
else else
vim.notify('Password is required, Save cancelled', vim.log.levels.WARN) vim.notify('Save cancelled', vim.log.levels.WARN)
end end
elseif choice:lower() == 'n' then elseif choice:lower() == 'n' then
toggle_undotree_twice(callback) toggle_undotree_twice(callback)