irongit

A Neovim plugin enabling you to solve LeetCode problems.

fix: add support for `snacks.nvim` (#148)

kawreauthored
parent 9197cf8commit 5d8b30f554f6a36055fde0fe3752c3c9eaf57974Browse files

3 files changed, +4 -10

+0-4README.md
@@ -34,8 +34,6 @@ https://github.com/kawre/leetcode.nvim/assets/69250723/aee6584c-e099-4409-b114-1
3434 used for formatting the question description.
3535 Can be installed with [nvim-treesitter].
3636
37-- [nvim-notify] _**(optional)**_
38-
3937 - [Nerd Font][nerd-font] & [nvim-web-devicons] _**(optional)**_
4038
4139 ## 📦 Installation
@@ -53,7 +51,6 @@ https://github.com/kawre/leetcode.nvim/assets/69250723/aee6584c-e099-4409-b114-1
5351
5452 -- optional
5553 "nvim-treesitter/nvim-treesitter",
56- "rcarriga/nvim-notify",
5754 "nvim-tree/nvim-web-devicons",
5855 },
5956 opts = {
@@ -493,7 +490,6 @@ You can then exit [leetcode.nvim] using `:Leet exit` command
493490 [neovim]: https://github.com/neovim/neovim
494491 [nerd-font]: https://www.nerdfonts.com
495492 [nui.nvim]: https://github.com/MunifTanjim/nui.nvim
496-[nvim-notify]: https://github.com/rcarriga/nvim-notify
497493 [nvim-treesitter]: https://github.com/nvim-treesitter/nvim-treesitter
498494 [nvim-web-devicons]: https://github.com/nvim-tree/nvim-web-devicons
499495 [telescope.nvim]: https://github.com/nvim-telescope/telescope.nvim
+0-5lua/leetcode/logger/init.lua
@@ -1,8 +1,3 @@
1-local n_ok, notify = pcall(require, "notify")
2-if n_ok then
3- vim.notify = notify
4-end
5-
61 local config = require("leetcode.config")
72 local t = require("leetcode.translator")
83 local lvls = vim.log.levels
+4-1lua/leetcode/logger/spinner/init.lua
@@ -73,11 +73,14 @@ function spinner:set(msg, lvl, opts)
7373 end
7474 lvl = lvl or vim.log.levels.INFO
7575
76+ local id = self.noti and (self.noti.id or self.noti)
77+
7678 opts = vim.tbl_deep_extend("force", {
7779 hide_from_history = true,
7880 title = config.name,
7981 timeout = false,
80- replace = self.noti,
82+ replace = id,
83+ id = id,
8184 }, opts or {})
8285
8386 self.noti = vim.notify(self.msg, lvl, opts)