lewis6991 / satellite.nvim

Decorate scrollbar for Neovim
MIT License
542 stars 20 forks source link

Use vim.notify instead of error()? #46

Closed delphinus closed 1 year ago

delphinus commented 1 year ago

Is your feature request related to a problem? Please describe.

The current build shows errors by the error() function. Neovim cannot deal with them well, so they are always shown as INFO level.

https://github.com/lewis6991/satellite.nvim/blob/022c884978b888d5b5812052c64d0d243092155e/lua/satellite/async.lua#L50-L56

Describe the solution you'd like Neovim has the comprehensive way for notifications: vim.notify. Users can overwrite this func to filter or change contents with nvim-notify, for example.

-- show error on red color (in most colorschemes).
vim.notify("some_error_msg", vim.log.levels.ERROR)
-- error() exits the thread immediately, but vim.notify does not.
return

Describe alternatives you've considered

Additional context

lewis6991 commented 1 year ago

vim.notify should not be used for internal errors.