remove other vim.notify calls and use log everywhere

This commit is contained in:
Thomas Ruoff
2025-06-05 11:18:20 +02:00
parent db4f67303a
commit a503c452b6

View File

@@ -1,8 +1,9 @@
local plugin_name = 'rooter'
local log_level = vim.log.levels.WARN
local function log(msg, level)
if level == vim.log.levels.ERROR then
vim.notify(msg, level)
vim.notify(plugin_name .. ':' .. msg, level)
else
print(msg)
end
@@ -56,17 +57,14 @@ end
local function on_lsp_attach()
local root = get_root()
if root then
vim.notify('root_dir detected: ' .. root, log_level)
log('root_dir detected: ' .. root, log_level)
vim.cmd('lcd ' .. root)
else
vim.notify('No project root found', log_level)
log('No project root found', log_level)
end
end
local debounced_on_attacched = debounce(function()
on_lsp_attach()
vim.notify 'on_attach_done'
end, 1000)
local debounced_on_attacched = debounce(function() on_lsp_attach() end, 1000)
local M = {}