@@ -207,14 +207,14 @@ function! s:PrintProblemList() abort
207207
208208 call append (' $' , [printf (' ## Difficulty [%s]' , b: leetcode_difficulty ), ' ' ])
209209 let b: leetcode_difficulty_start_line = line (' $' )
210- let difficulty_line = <SID> FormatIntoColumns (<SID> difficulty_tags ())
210+ let difficulty_line = s: FormatIntoColumns (s: PrintDifficultyTags ())
211211 call append (' $' , difficulty_line)
212212 let b: leetcode_difficulty_end_line = line (' $' )
213213 call append (' $' , ' ' )
214214
215- call append (' $' , [printf (' ## Status [%s]' , <SID> state2status (b: leetcode_state )), ' ' ])
215+ call append (' $' , [printf (' ## Status [%s]' , s: StateToName (b: leetcode_state )), ' ' ])
216216 let b: leetcode_status_start_line = line (' $' )
217- let status_line = <SID> FormatIntoColumns (<SID> status_tags ())
217+ let status_line = s: FormatIntoColumns (s: PrintStatusTags ())
218218 call append (' $' , status_line)
219219 let b: leetcode_status_end_line = line (' $' )
220220 call append (' $' , ' ' )
@@ -249,8 +249,8 @@ function! s:PrintProblemList() abort
249249
250250 let problem_lines = []
251251 for problem in sorted_problems
252- if b: leetcode_difficulty != ' All' && b: leetcode_difficulty != problem[' level' ] ||
253- \ b: leetcode_state != ' All' && b: leetcode_state != problem[' state' ]
252+ if b: leetcode_difficulty !=# ' All' && b: leetcode_difficulty !=# problem[' level' ] ||
253+ \ b: leetcode_state !=# ' All' && b: leetcode_state !=# problem[' state' ]
254254 continue
255255 endif
256256 let title = substitute (problem[' title' ], ' `' , " '" , ' g' )
@@ -268,30 +268,30 @@ function! s:PrintProblemList() abort
268268 let b: leetcode_problem_end_line = line (' $' )
269269endfunction
270270
271- function ! s: difficulty_tags ()
272- let tags = {' All' :0 , ' Easy' :0 , ' Medium' : 0 , ' Hard' :0 }
271+ function ! s: PrintDifficultyTags ()
272+ let tags = {' All' : 0 , ' Easy' : 0 , ' Medium' : 0 , ' Hard' : 0 }
273273 for problem in b: leetcode_problems
274274 let tags [' All' ] += 1
275275 let tags [problem[' level' ]] += 1
276276 endfor
277277 return [
278- \ printf (" All:%d" , tags [' All' ]),
279- \ printf (" Easy:%d" , tags [' Easy' ]),
280- \ printf (" Medium:%d" , tags [' Medium' ]),
281- \ printf (" Hard:%d" , tags [' Hard' ])]
278+ \ printf (' All:%d' , tags [' All' ]),
279+ \ printf (' Easy:%d' , tags [' Easy' ]),
280+ \ printf (' Medium:%d' , tags [' Medium' ]),
281+ \ printf (' Hard:%d' , tags [' Hard' ])]
282282endfunction
283283
284- function ! s: status_tags ()
285- let tags = {' All' :0 , ' Todo' :0 , ' Solved' :0 , ' Attempted' :0 }
284+ function ! s: PrintStatusTags ()
285+ let tags = {' All' : 0 , ' Todo' : 0 , ' Solved' : 0 , ' Attempted' : 0 }
286286 for problem in b: leetcode_problems
287287 let tags [' All' ] += 1
288- let tags [<SID> state2status (problem[' state' ])] += 1
288+ let tags [s: StateToName (problem[' state' ])] += 1
289289 endfor
290290 return [
291- \ printf (" All:%d" , tags [' All' ]),
292- \ printf (" Todo:%d" , tags [' Todo' ]),
293- \ printf (" Solved:%d" , tags [' Solved' ]),
294- \ printf (" Attempted:%d" , tags [' Attempted' ])]
291+ \ printf (' All:%d' , tags [' All' ]),
292+ \ printf (' Todo:%d' , tags [' Todo' ]),
293+ \ printf (' Solved:%d' , tags [' Solved' ]),
294+ \ printf (' Attempted:%d' , tags [' Attempted' ])]
295295endfunction
296296
297297function ! s: ListProblemsOfTopic (topic_slug, refresh) abort
@@ -381,7 +381,7 @@ function! s:ListProblemsOfCompany(company_slug, refresh) abort
381381 let b: leetcode_buffer_type = ' company'
382382 let b: leetcode_buffer_company = a: company_slug
383383 let b: leetcode_time_period = ' six-months'
384- nnoremap <buffer> t :call <SID> ChooseTimePeriod()<cr>
384+ nnoremap <buffer> t :call s: ChooseTimePeriod()<cr>
385385
386386 let expr = printf (' leetcode.get_problems_of_company("%s")' ,
387387 \ a: company_slug )
@@ -495,7 +495,7 @@ function! s:HandleProblemListCR() abort
495495 if line_nr >= b: leetcode_topic_start_line &&
496496 \ line_nr < b: leetcode_topic_end_line
497497 let topic_slug = expand (' <cWORD>' )
498- let topic_slug = <SID> TagName (topic_slug)
498+ let topic_slug = s: TagName (topic_slug)
499499 if topic_slug != ' '
500500 call s: ListProblemsOfTopic (topic_slug, ' norefresh' )
501501 endif
@@ -505,7 +505,7 @@ function! s:HandleProblemListCR() abort
505505 if line_nr >= b: leetcode_company_start_line &&
506506 \ line_nr < b: leetcode_company_end_line
507507 let company_slug = expand (' <cWORD>' )
508- let company_slug = <SID> TagName (company_slug)
508+ let company_slug = s: TagName (company_slug)
509509 if company_slug != ' '
510510 call s: ListProblemsOfCompany (company_slug, ' norefresh' )
511511 endif
@@ -515,32 +515,32 @@ function! s:HandleProblemListCR() abort
515515 if line_nr >= b: leetcode_difficulty_start_line &&
516516 \ line_nr < b: leetcode_difficulty_end_line
517517 let difficulty_slug = expand (' <cWORD>' )
518- let difficulty_slug = <SID> TagName (difficulty_slug)
518+ let difficulty_slug = s: TagName (difficulty_slug)
519519 if difficulty_slug != ' '
520520 if b: leetcode_difficulty != difficulty_slug
521521 let b: leetcode_difficulty = difficulty_slug
522- call <SID> redraw ()
522+ call s: RedrawProblemList ()
523523 endif
524524 endif
525525 endif
526526
527527 if line_nr >= b: leetcode_status_start_line &&
528528 \ line_nr < b: leetcode_status_end_line
529529 let status_slug = expand (' <cWORD>' )
530- let status_slug = <SID> TagName (status_slug)
530+ let status_slug = s: TagName (status_slug)
531531 if status_slug != ' '
532- let new_state = <SID> status2state (status_slug)
532+ let new_state = s: ParseState (status_slug)
533533 if b: leetcode_state != new_state
534534 let b: leetcode_state = new_state
535- call <SID> redraw ()
535+ call s: RedrawProblemList ()
536536 endif
537537 endif
538538 endif
539539
540540 if line_nr >= b: leetcode_problem_start_line &&
541541 \ line_nr < b: leetcode_problem_end_line
542- let problem_id = <SID> ProblemIdFromNr (line_nr)
543- let problem = <SID> GetProblem (problem_id)
542+ let problem_id = s: ProblemIdFromNr (line_nr)
543+ let problem = s: GetProblem (problem_id)
544544 let problem_slug = problem[' slug' ]
545545 let problem_ext = s: SolutionFileExt (g: leetcode_solution_filetype )
546546 let problem_file_name = printf (' %s.%s' , s: SlugToFileName (problem_slug),
@@ -556,7 +556,7 @@ function! s:HandleProblemListCR() abort
556556 endif
557557endfunction
558558
559- function ! s: status2state (status)
559+ function ! s: ParseState (status)
560560 if a: status == ' Todo'
561561 return ' '
562562 elseif a: status == ' Solved'
@@ -568,7 +568,7 @@ function! s:status2state(status)
568568 endif
569569endfunction
570570
571- function ! s: state2status (state )
571+ function ! s: StateToName (state )
572572 if a: state == ' '
573573 return ' Todo'
574574 elseif a: state == ' X'
@@ -580,7 +580,7 @@ function! s:state2status(state)
580580 endif
581581endfunction
582582
583- function ! s: redraw ()
583+ function ! s: RedrawProblemList ()
584584 if b: leetcode_buffer_type == # ' all'
585585 call leetcode#ListProblems (' redraw' )
586586 elseif b: leetcode_buffer_type == # ' topic'
@@ -657,7 +657,7 @@ function! s:HandleProblemListSort() abort
657657 let b: leetcode_sort_column = s: column_choice_map [column_choice]
658658 let b: leetcode_sort_order = s: order_choice_map [order_choice]
659659
660- call <SID> redraw ()
660+ call s: RedrawProblemList ()
661661endfunction
662662
663663let s: file_type_to_ext = {
@@ -885,7 +885,7 @@ function! s:AskTestInputAndRunTest(problem, filetype, code) abort
885885 let s: leetcode_code = a: code
886886 let s: leetcode_filetype = a: filetype
887887
888- autocmd BufUnload <buffer> call <SID> RunTest ()
888+ autocmd BufUnload <buffer> call s: RunTest ()
889889endfunction
890890
891891let s: comment_pattern = ' \v(^#.*)|(^\s*$)'
@@ -1069,7 +1069,7 @@ function! s:ShowRunResultInPreview(result) abort
10691069 hi ! link lcWarning lcFailure
10701070
10711071 execute saved_winnr . ' wincmd w'
1072- call <SID> UpdateSubmitState (a: result )
1072+ call s: UpdateSubmitState (a: result )
10731073endfunction
10741074
10751075function ! s: CheckRunCodeTask (timer) abort
@@ -1102,8 +1102,8 @@ function! s:HandleProblemListS() abort
11021102 let line_nr = line (' .' )
11031103 if line_nr >= b: leetcode_problem_start_line &&
11041104 \ line_nr < b: leetcode_problem_end_line
1105- let problem_id = <SID> ProblemIdFromNr (line_nr)
1106- let problem = <SID> GetProblem (problem_id)
1105+ let problem_id = s: ProblemIdFromNr (line_nr)
1106+ let problem = s: GetProblem (problem_id)
11071107 let problem_slug = problem[' slug' ]
11081108 call s: ListSubmissions (problem_slug, 0 )
11091109 endif
0 commit comments