Skip to content

Commit

Permalink
refactor: use echo_warning for notifications in the State module
Browse files Browse the repository at this point in the history
  • Loading branch information
PriceHiller committed Nov 8, 2023
1 parent 76beae3 commit d5c7f8f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lua/orgmode/state/state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function State:save()
end)
:catch(function(err_msg)
vim.schedule_wrap(function()
vim.notify('Failed to save current state! Error: ' .. err_msg, vim.log.levels.WARN, { title = 'Orgmode' })
utils.echo_warning('Failed to save current state! Error: ' .. err_msg)
end)
end)
end)
Expand Down Expand Up @@ -67,9 +67,7 @@ function State:load()
if not success then
local err_msg = vim.deepcopy(decoded)
vim.schedule(function()
vim.notify('State cache load failure, error: ' .. vim.inspect(err_msg), vim.log.levels.WARN, {
title = 'Orgmode',
})
utils.echo_warning('State cache load failure, error: ' .. vim.inspect(err_msg))
-- Try to 'repair' the cache by saving the current state
self:save()
end)
Expand Down

0 comments on commit d5c7f8f

Please sign in to comment.