A Neovim plugin enabling you to solve LeetCode problems.
fix(`Leet yank`): change window and buffer
2 files changed, +5 -3
+3-1lua/leetcode/command/init.lua
| @@ -177,8 +177,10 @@ function cmd.yank() | ||
| 177 | 177 | local q = utils.curr_question() |
| 178 | 178 | if not q then return end |
| 179 | 179 | |
| 180 | - if vim.api.nvim_win_is_valid(q.winid) then | |
| 180 | + if vim.api.nvim_buf_is_valid(q.bufnr) and vim.api.nvim_win_is_valid(q.winid) then | |
| 181 | 181 | vim.api.nvim_set_current_win(q.winid) |
| 182 | + vim.api.nvim_set_current_buf(q.bufnr) | |
| 183 | + | |
| 182 | 184 | local start_i, end_i = q:range() |
| 183 | 185 | vim.cmd(("%d,%dyank"):format(start_i, end_i)) |
| 184 | 186 | end |
+2-2lua/leetcode/config/template.lua
| @@ -53,8 +53,8 @@ local M = { | ||
| 53 | 53 | |
| 54 | 54 | ---@type lc.storage |
| 55 | 55 | storage = { |
| 56 | - home = vim.fn.stdpath("data") .. "/leetcode/", | |
| 57 | - cache = vim.fn.stdpath("cache") .. "/leetcode/", | |
| 56 | + home = vim.fn.stdpath("data") .. "/leetcode", | |
| 57 | + cache = vim.fn.stdpath("cache") .. "/leetcode", | |
| 58 | 58 | }, |
| 59 | 59 | |
| 60 | 60 | ---@type boolean |