kaiwk / leetcode.el

An Emacs LeetCode client.
GNU General Public License v3.0
409 stars 73 forks source link

Feature: Support to navigate problems in LC-Problems buffer #79

Closed limoiie closed 3 years ago

limoiie commented 3 years ago

Support to directly navigate in LC-Problems buffer by specifying a problem id (or the current one by default). These actions can also be performed by calling related interactive functions. Additionally, each action has its own 'current' version that performs on the current problem with no need to specify one manually.

A more complete specification is shown in the table below:

action interactive function hotkey in LC-Problems
show* leetcode-show-current-problem i or RET
show leetcode-show-problem I
show-in-browser* leetcode-show-current-problem-in-browser b
show-in-browser leetcode-show-problem-in-browser B
view* leetcode-view-current-problem v or TAB
view leetcode-view-problem V
start-coding* leetcode-solve-current-problem c
start-coding leetcode-solve-problem C

Note the actions that end with '*' are the 'current' version.

Besides, the action view is similar to the action show, except that view will stay in the LC-Problems buffer after opening the description page. This could be very useful when someone just wants to glance over the problems to find an appropriate one.

Address issue #66.

limoiie commented 3 years ago

I just found that in the problem object there also is a field named pos which is pretty similar to id. Fetched problems in leetcode--all-problems continue on the field pos but not on the filed id, which means some problems are missing in leetcode--all-problems. This issue may break the way to navigate problems by id. So I will fix this first and then reopen the pr.