Skip to content

Commit d84917f

Browse files
tenfyzhongianding1
authored andcommitted
Add an option named g:leetcode_hide_paid_only to hide the paid only problems.
1 parent 11d9a4b commit d84917f

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ Values: `'disabled'`, `'chrome'`, `'firefox'`
8888

8989
Default value is `'disabled'`.
9090

91+
### `g:leetcode_hide_paid_only`
92+
93+
Hide the paid only problems on the list.
94+
95+
Default value is `0`.
96+
9197
## Updates
9298

9399
- 2019/12/20: Fix the login issue caused by reCAPTCHA.

autoload/leetcode.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ function! s:PrintProblemList() abort
147147
endif
148148

149149
let b:leetcode_problems = sorted_problems
150+
if g:leetcode_hide_paid_only
151+
call filter(b:leetcode_problems, 'v:val["paid_only"] == 0')
152+
endif
150153

151154
let id_width = s:MaxWidthOfKey(sorted_problems, 'fid', 1)
152155
let title_width = s:MaxWidthOfKey(sorted_problems, 'title', 1) + 4

doc/leetcode.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,10 @@ g:leetcode_solution_filetype
7979
"javascript", "ruby", "swift", "golang", "scala",
8080
"kotlin", "rust"
8181

82+
*g:leetcode_hide_paid_only*
83+
g:leetcode_hide_paid_only
84+
Hide the paid only problems on the list.
85+
86+
Default: 0
87+
8288
vim:tw=78:ts=8:et:ft=help:norl:

plugin/leetcode.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ if !exists('g:leetcode_debug')
2020
let g:leetcode_debug = 0
2121
endif
2222

23+
if !exists('g:leetcode_hide_paid_only')
24+
let g:leetcode_hide_paid_only = 0
25+
endif
26+
2327
command! -nargs=0 LeetCodeList call leetcode#ListProblems('redraw')
2428
command! -nargs=0 LeetCodeReset call leetcode#ResetSolution(0)
2529
command! -nargs=0 LeetCodeTest call leetcode#TestSolution()

0 commit comments

Comments
 (0)