mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-22 02:09:04 +02:00
refactor(plugins)!: remove nvim-notify from core (#3300)
This commit is contained in:
parent
30c65cfd74
commit
36c8bdee9f
9 changed files with 12 additions and 109 deletions
|
@ -46,6 +46,11 @@ function M:init()
|
||||||
friendly_snippets = true,
|
friendly_snippets = true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
---@deprecated
|
||||||
|
lvim.builtin.notify = {
|
||||||
|
active = false
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local function handle_deprecated_settings()
|
local function handle_deprecated_settings()
|
||||||
|
@ -93,6 +98,13 @@ local function handle_deprecated_settings()
|
||||||
deprecation_notice("lvim.builtin.dashboard", "Use `lvim.builtin.alpha` instead. See LunarVim#1906")
|
deprecation_notice("lvim.builtin.dashboard", "Use `lvim.builtin.alpha` instead. See LunarVim#1906")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- notify.nvim
|
||||||
|
if lvim.builtin.notify.active then
|
||||||
|
deprecation_notice("lvim.builtin.notify", "See LunarVim#3294")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
if lvim.autocommands.custom_groups then
|
if lvim.autocommands.custom_groups then
|
||||||
deprecation_notice(
|
deprecation_notice(
|
||||||
"lvim.autocommands.custom_groups",
|
"lvim.autocommands.custom_groups",
|
||||||
|
|
|
@ -18,7 +18,6 @@ local builtins = {
|
||||||
"lvim.core.bufferline",
|
"lvim.core.bufferline",
|
||||||
"lvim.core.autopairs",
|
"lvim.core.autopairs",
|
||||||
"lvim.core.comment",
|
"lvim.core.comment",
|
||||||
"lvim.core.notify",
|
|
||||||
"lvim.core.lualine",
|
"lvim.core.lualine",
|
||||||
"lvim.core.alpha",
|
"lvim.core.alpha",
|
||||||
"lvim.core.mason",
|
"lvim.core.mason",
|
||||||
|
|
|
@ -1,72 +0,0 @@
|
||||||
local M = {}
|
|
||||||
|
|
||||||
local Log = require "lvim.core.log"
|
|
||||||
|
|
||||||
local defaults = {
|
|
||||||
active = true,
|
|
||||||
on_config_done = nil,
|
|
||||||
opts = {
|
|
||||||
---@usage Animation style one of { "fade", "slide", "fade_in_slide_out", "static" }
|
|
||||||
stages = "slide",
|
|
||||||
|
|
||||||
---@usage Function called when a new window is opened, use for changing win settings/config
|
|
||||||
on_open = nil,
|
|
||||||
|
|
||||||
---@usage Function called when a window is closed
|
|
||||||
on_close = nil,
|
|
||||||
|
|
||||||
---@usage timeout for notifications in ms, default 5000
|
|
||||||
timeout = 5000,
|
|
||||||
|
|
||||||
-- Render function for notifications. See notify-render()
|
|
||||||
render = "default",
|
|
||||||
|
|
||||||
---@usage highlight behind the window for stages that change opacity
|
|
||||||
background_colour = "Normal",
|
|
||||||
|
|
||||||
---@usage minimum width for notification windows
|
|
||||||
minimum_width = 50,
|
|
||||||
|
|
||||||
---@usage Icons for the different levels
|
|
||||||
icons = {
|
|
||||||
ERROR = lvim.icons.diagnostics.Error,
|
|
||||||
WARN = lvim.icons.diagnostics.Warning,
|
|
||||||
INFO = lvim.icons.diagnostics.Information,
|
|
||||||
DEBUG = lvim.icons.diagnostics.Debug,
|
|
||||||
TRACE = lvim.icons.diagnostics.Trace,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
function M.config()
|
|
||||||
if not lvim.use_icons then
|
|
||||||
defaults.opts.icons = {
|
|
||||||
ERROR = "[ERROR]",
|
|
||||||
WARN = "[WARNING]",
|
|
||||||
INFO = "[INFO]",
|
|
||||||
DEBUG = "[DEBUG]",
|
|
||||||
TRACE = "[TRACE]",
|
|
||||||
}
|
|
||||||
end
|
|
||||||
lvim.builtin.notify = vim.tbl_deep_extend("force", defaults, lvim.builtin.notify or {})
|
|
||||||
end
|
|
||||||
|
|
||||||
function M.setup()
|
|
||||||
if #vim.api.nvim_list_uis() == 0 then
|
|
||||||
-- no need to configure notifications in headless
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local opts = lvim.builtin.notify and lvim.builtin.notify.opts or defaults
|
|
||||||
|
|
||||||
local status_ok, notify = pcall(require, "notify")
|
|
||||||
if not status_ok then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
notify.setup(opts)
|
|
||||||
vim.notify = notify
|
|
||||||
Log:configure_notifications(notify)
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
|
@ -147,23 +147,6 @@ function M.setup()
|
||||||
return
|
return
|
||||||
end
|
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
|
if lvim.builtin.nvimtree._setup_called then
|
||||||
Log:debug "ignoring repeated setup call for nvim-tree, see kyazdani42/nvim-tree.lua#1308"
|
Log:debug "ignoring repeated setup call for nvim-tree, see kyazdani42/nvim-tree.lua#1308"
|
||||||
|
|
|
@ -164,12 +164,6 @@ function M.setup()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
if lvim.builtin.notify.active then
|
|
||||||
pcall(function()
|
|
||||||
require("telescope").load_extension "notify"
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
if lvim.builtin.telescope.on_config_done then
|
if lvim.builtin.telescope.on_config_done then
|
||||||
lvim.builtin.telescope.on_config_done(telescope)
|
lvim.builtin.telescope.on_config_done(telescope)
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,14 +17,6 @@ local core_plugins = {
|
||||||
{
|
{
|
||||||
"folke/tokyonight.nvim",
|
"folke/tokyonight.nvim",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"rcarriga/nvim-notify",
|
|
||||||
config = function()
|
|
||||||
require("lvim.core.notify").setup()
|
|
||||||
end,
|
|
||||||
requires = { "nvim-telescope/telescope.nvim" },
|
|
||||||
disable = not lvim.builtin.notify.active or not lvim.builtin.telescope.active,
|
|
||||||
},
|
|
||||||
{ "Tastyep/structlog.nvim" },
|
{ "Tastyep/structlog.nvim" },
|
||||||
|
|
||||||
{ "nvim-lua/popup.nvim" },
|
{ "nvim-lua/popup.nvim" },
|
||||||
|
|
|
@ -71,9 +71,6 @@
|
||||||
"nvim-navic": {
|
"nvim-navic": {
|
||||||
"commit": "132b273"
|
"commit": "132b273"
|
||||||
},
|
},
|
||||||
"nvim-notify": {
|
|
||||||
"commit": "af935fd"
|
|
||||||
},
|
|
||||||
"nvim-tree.lua": {
|
"nvim-tree.lua": {
|
||||||
"commit": "c446527"
|
"commit": "c446527"
|
||||||
},
|
},
|
||||||
|
|
|
@ -64,7 +64,6 @@ lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
|
||||||
-- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
|
-- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
|
||||||
lvim.builtin.alpha.active = true
|
lvim.builtin.alpha.active = true
|
||||||
lvim.builtin.alpha.mode = "dashboard"
|
lvim.builtin.alpha.mode = "dashboard"
|
||||||
lvim.builtin.notify.active = true
|
|
||||||
lvim.builtin.terminal.active = true
|
lvim.builtin.terminal.active = true
|
||||||
lvim.builtin.nvimtree.setup.view.side = "left"
|
lvim.builtin.nvimtree.setup.view.side = "left"
|
||||||
lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
|
lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
|
||||||
|
|
|
@ -80,7 +80,6 @@ lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
|
||||||
-- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
|
-- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
|
||||||
lvim.builtin.alpha.active = true
|
lvim.builtin.alpha.active = true
|
||||||
lvim.builtin.alpha.mode = "dashboard"
|
lvim.builtin.alpha.mode = "dashboard"
|
||||||
lvim.builtin.notify.active = true
|
|
||||||
lvim.builtin.terminal.active = false
|
lvim.builtin.terminal.active = false
|
||||||
-- lvim.builtin.terminal.shell = "pwsh.exe -NoLogo"
|
-- lvim.builtin.terminal.shell = "pwsh.exe -NoLogo"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue