feat: a less noisy tree (#3042)

This commit is contained in:
Christian Chiarulli 2022-09-19 19:35:57 -04:00 committed by GitHub
parent bb4a3769f9
commit 2190dba4c7
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View file

@ -1,6 +1,6 @@
local M = {}
local Log = require "lvim.core.log"
-- local Log = require "lvim.core.log"
M.config = function()
lvim.builtin.lir = {

View file

@ -147,6 +147,24 @@ function M.setup()
return
end
local status_ok_1, utils = pcall(require, "nvim-tree.utils")
if not status_ok_1 then
return
end
local function notify_level()
return function(msg)
vim.schedule(function()
vim.api.nvim_echo({ { msg, "WarningMsg" } }, false, {})
end)
end
end
utils.notify.warn = notify_level(vim.log.levels.WARN)
utils.notify.error = notify_level(vim.log.levels.ERROR)
utils.notify.info = notify_level(vim.log.levels.INFO)
utils.notify.debug = notify_level(vim.log.levels.DEBUG)
if lvim.builtin.nvimtree._setup_called then
Log:debug "ignoring repeated setup call for nvim-tree, see kyazdani42/nvim-tree.lua#1308"
return