Skip to content

Add in-place question shuffle feature (no more buffer clutter!) #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MandalTuhin
Copy link

This PR adds a “shuffle” feature to LeetCode.nvim, allowing users to load a new random question in the same buffer, with the question info panel updating as well. Previously, using the random feature would open a new buffer each time, requiring manual cleanup. Now, users can quickly browse random questions—just like the shuffle button on the LeetCode website!

Key changes:

  • Adds a shuffle() method to the Question object
  • Updates the code and info buffers in-place
  • Keymap example: ls to shuffle in the current question buffer

Benefits:

  • Much faster random question browsing
  • No buffer clutter

I’d love feedback and am happy to make changes as needed!

I have made changes to the questions ui.
This commit tries to fix the error shown by nvim when trying to shuffle
questions.
This commit attempts to fix the random question functionality of
leetcode.nvim.
This puts the function at the bottom of the question.lua so that it
doesn't interfere with other files.
This commit tries to reload the description buffer/panel with each
shuffle to correctly represent the problem we are currently in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant