kawre / leetcode.nvim

A Neovim plugin enabling you to solve LeetCode problems.
MIT License
654 stars 34 forks source link

Feature request: Add a recent list #68

Open HakonHarnes opened 3 months ago

HakonHarnes commented 3 months ago

Description

I often find myself revisiting leetcode problems to redo them. Having a list of recent leetcode problems that I have opened (i.e. a history of problems) would be convenient. The list should be sorted in most-recent order.

Proposed solution

This could be implemented by creating a file which keeps track of recently opened leetcode problems. The feature could be implemented as:

  1. Leet recent command with an entry in Menu -> Problems -> Recent
  2. Leet history command with an entry in Menu -> Problems -> History

Alternatively, a suitable Leetcode API endpoint could be used, if it exists.

yangrq1018 commented 3 months ago

I felt like history functionality is a good idea. By the way, the current implementation overwrites former work regardless of whether you've submitted it or not. The Leet history thing should kind of restore previous work in some way.

kawre commented 3 months ago

Is what you are looking for? Also, what would be the condition to add a question to recent list? Right now, it only gets added if the question was run, since adding questions only if they were opened would flood the list with useless data rather quickly, I guess.

HakonHarnes commented 3 months ago

Exactly what I'm looking for. Thanks!

Right now, it only gets added if the question was run, since adding questions only if they were opened would flood the list with useless data rather quickly, I guess.

Seems like the best approach!

HakonHarnes commented 3 months ago

Realized the PR hasn't been merged yet. Re-opening the issue until then.