A Neovim plugin enabling you to solve LeetCode problems.
fix: add support for `snacks.nvim` (#148)
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 | ||
| 34 | 34 | used for formatting the question description. |
| 35 | 35 | Can be installed with [nvim-treesitter]. |
| 36 | 36 | |
| 37 | -- [nvim-notify] _**(optional)**_ | |
| 38 | - | |
| 39 | 37 | - [Nerd Font][nerd-font] & [nvim-web-devicons] _**(optional)**_ |
| 40 | 38 | |
| 41 | 39 | ## 📦 Installation |
| @@ -53,7 +51,6 @@ https://github.com/kawre/leetcode.nvim/assets/69250723/aee6584c-e099-4409-b114-1 | ||
| 53 | 51 | |
| 54 | 52 | -- optional |
| 55 | 53 | "nvim-treesitter/nvim-treesitter", |
| 56 | - "rcarriga/nvim-notify", | |
| 57 | 54 | "nvim-tree/nvim-web-devicons", |
| 58 | 55 | }, |
| 59 | 56 | opts = { |
| @@ -493,7 +490,6 @@ You can then exit [leetcode.nvim] using `:Leet exit` command | ||
| 493 | 490 | [neovim]: https://github.com/neovim/neovim |
| 494 | 491 | [nerd-font]: https://www.nerdfonts.com |
| 495 | 492 | [nui.nvim]: https://github.com/MunifTanjim/nui.nvim |
| 496 | -[nvim-notify]: https://github.com/rcarriga/nvim-notify | |
| 497 | 493 | [nvim-treesitter]: https://github.com/nvim-treesitter/nvim-treesitter |
| 498 | 494 | [nvim-web-devicons]: https://github.com/nvim-tree/nvim-web-devicons |
| 499 | 495 | [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 | - | |
| 6 | 1 | local config = require("leetcode.config") |
| 7 | 2 | local t = require("leetcode.translator") |
| 8 | 3 | local lvls = vim.log.levels |
+4-1lua/leetcode/logger/spinner/init.lua
| @@ -73,11 +73,14 @@ function spinner:set(msg, lvl, opts) | ||
| 73 | 73 | end |
| 74 | 74 | lvl = lvl or vim.log.levels.INFO |
| 75 | 75 | |
| 76 | + local id = self.noti and (self.noti.id or self.noti) | |
| 77 | + | |
| 76 | 78 | opts = vim.tbl_deep_extend("force", { |
| 77 | 79 | hide_from_history = true, |
| 78 | 80 | title = config.name, |
| 79 | 81 | timeout = false, |
| 80 | - replace = self.noti, | |
| 82 | + replace = id, | |
| 83 | + id = id, | |
| 81 | 84 | }, opts or {}) |
| 82 | 85 | |
| 83 | 86 | self.noti = vim.notify(self.msg, lvl, opts) |