rcarriga / nvim-notify

A fancy, configurable, notification manager for NeoVim
MIT License
2.97k stars 78 forks source link

Use of vim.lsp.log_levels #161

Closed aloknigam247 closed 12 months ago

aloknigam247 commented 1 year ago

I was trying to optimise my configs for minimal time and lazy loaded all my lsp plugins to load only for filetype whose lsp server are installed.

I found that nvim-notify depends on vim.lsp and increases load time.

Instead of using vim.lsp.log_levels, vim.lo.levels can be used which is faster and dependency free.

Also the table retruned by vim.lsp.log_levels and vim.log.levels are almost identical.

rcarriga commented 1 year ago

Replaced all usage of vim.lsp.log_levels :+1:

ievgenii-shepeliuk commented 1 year ago

Hello

I think my bug is related to this issue. I am replacing internal vim.notify(..) with the function from this plugin. I've updated to version 3.10 and now vim.notify(..) is not working as expected with log levels. It looks like the plugin ignores the passed constant and always uses vim.log.levels.INFO instead.

I.e. when calling following - the popup is still displayed as INFO.

:lua vim.notify("qwe", vim.log.levels.WARN)

Another issue - is that this plugin's vim.notify(..) implementation accepts log level as string ( although is it a number). I.e. - following statement works as expected

:lua vim.notify("qwe", "warn")
rcarriga commented 1 year ago

Missed a conversion, should be fixed in master now

ievgenii-shepeliuk commented 1 year ago

Confirmed, it works. Thanks.

Kruziikrel13 commented 1 year ago

That means this can be closed now right?

ievgenii-shepeliuk commented 1 year ago

from my side, it worked.