summaryrefslogtreecommitdiff
path: root/lua/lvim/core
diff options
context:
space:
mode:
authorMark Huggins <[email protected]>2022-10-21 01:21:22 -0400
committerMark Huggins <[email protected]>2022-10-24 10:40:00 +0200
commit30629e1a625a20eeebaa2d0ecdc79f7c26d1626c (patch)
treedaf9a5d1a5e2d22beb85c460579d7d58a61b7d03 /lua/lvim/core
parentccd6d367b77d6ca2cd265f2c13e44e5cb09cc6b2 (diff)
refactor(plugins)!: remove nvim-notify from core (#3300)
Diffstat (limited to 'lua/lvim/core')
-rw-r--r--lua/lvim/core/builtins/init.lua1
-rw-r--r--lua/lvim/core/notify.lua72
-rw-r--r--lua/lvim/core/nvimtree.lua17
-rw-r--r--lua/lvim/core/telescope.lua6
4 files changed, 0 insertions, 96 deletions
diff --git a/lua/lvim/core/builtins/init.lua b/lua/lvim/core/builtins/init.lua
index 0060c460..4764ff70 100644
--- a/lua/lvim/core/builtins/init.lua
+++ b/lua/lvim/core/builtins/init.lua
@@ -18,7 +18,6 @@ local builtins = {
"lvim.core.bufferline",
"lvim.core.autopairs",
"lvim.core.comment",
- "lvim.core.notify",
"lvim.core.lualine",
"lvim.core.alpha",
"lvim.core.mason",
diff --git a/lua/lvim/core/notify.lua b/lua/lvim/core/notify.lua
deleted file mode 100644
index b08c45a6..00000000
--- a/lua/lvim/core/notify.lua
+++ /dev/null
@@ -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
diff --git a/lua/lvim/core/nvimtree.lua b/lua/lvim/core/nvimtree.lua
index 199279a6..d98816f5 100644
--- a/lua/lvim/core/nvimtree.lua
+++ b/lua/lvim/core/nvimtree.lua
@@ -147,23 +147,6 @@ 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"
diff --git a/lua/lvim/core/telescope.lua b/lua/lvim/core/telescope.lua
index 77bf552d..0cfe0b23 100644
--- a/lua/lvim/core/telescope.lua
+++ b/lua/lvim/core/telescope.lua
@@ -164,12 +164,6 @@ function M.setup()
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
lvim.builtin.telescope.on_config_done(telescope)
end