From 22761df22b22d6d940585964293d20d2868d2dcc Mon Sep 17 00:00:00 2001 From: Pedro Mendes Date: Sat, 9 Nov 2024 14:08:23 -0300 Subject: [PATCH] fix(notifications): use `vim.log.levels` --- autoload/db_ui/notifications.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/autoload/db_ui/notifications.vim b/autoload/db_ui/notifications.vim index 2b0109a..7f0335c 100644 --- a/autoload/db_ui/notifications.vim +++ b/autoload/db_ui/notifications.vim @@ -95,7 +95,14 @@ function! s:notification_nvim_notify(msg, opts) abort if get(a:opts, 'delay') let opts.timeout = { 'timeout': a:opts.delay } endif - return luaeval('vim.notify(_A[1], _A[2], _A[3])', [a:msg, type, opts]) + + let log_levels = { + \ 'info': luaeval("vim.log.levels.INFO"), + \ 'error': luaeval("vim.log.levels.ERROR"), + \ 'warning': luaeval("vim.log.levels.WARN") + \ } + + return luaeval('vim.notify(_A[1], _A[2], _A[3])', [a:msg, log_levels[type], opts]) endfunction function! s:notification_nvim(msg, opts) abort