Dhanus3133 / Leetbuddy.nvim

Solve Leetcode problems within Neovim 🔥
MIT License
138 stars 15 forks source link

Run test code or Submit Code got some error #7

Closed andyli386 closed 1 year ago

andyli386 commented 1 year ago

Hello, thanks for supporting leetcode.cn. It's ok when I run 0001-two-sum and submit it. But when I run 1049-last-stone-weight-ii locally get error below:

Error executing vim.schedule lua callback: ...share/nvim/lazy/LeetBuddy.nvim/lua/leetbuddy/display.lua:115: attempt to get length of l
ocal 'std_output' (a nil value)
stack traceback:
        ...share/nvim/lazy/LeetBuddy.nvim/lua/leetbuddy/display.lua:115: in function 'display_results'
        .../share/nvim/lazy/LeetBuddy.nvim/lua/leetbuddy/runner.lua:88: in function 'check_id'
        .../share/nvim/lazy/LeetBuddy.nvim/lua/leetbuddy/runner.lua:103: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

When I submit 1049-last-stone-weight-ii get error below:

Error executing vim.schedule lua callback: ...share/nvim/lazy/LeetBuddy.nvim/lua/leetbuddy/display.lua:136: attempt to call global 'P'
 (a nil value)
stack traceback:
        ...share/nvim/lazy/LeetBuddy.nvim/lua/leetbuddy/display.lua:136: in function 'display_results'
        .../share/nvim/lazy/LeetBuddy.nvim/lua/leetbuddy/runner.lua:88: in function 'check_id'
        .../share/nvim/lazy/LeetBuddy.nvim/lua/leetbuddy/runner.lua:103: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

And also a little issue. 1, when I finish one question and use cmd "\<leader>lq" to find and switch a new one the input.txt is not update. 2, when I open the old question the cursor will focus on the output window.

And how to close the popup window after cmd "\<leader>ll", I use "ctrl+w q" to close the popup window, is there any convenient way?

Thanks for your job!

Dhanus3133 commented 1 year ago

Hey @andyli386, thanks for letting me know about the issue. Everything are now fixed. Let me know if there are any other issues.

To close the popup question window, you can just use q or <ESC> and no need for prefixing it with "Ctrl w". Soon will update with toggle like feature too :)