File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -527,7 +527,7 @@ function! s:HandleProblemListCR() abort
527527 let problem = s: GetProblem (problem_id)
528528 let problem_slug = problem[' slug' ]
529529 let problem_ext = s: SolutionFileExt (g: leetcode_solution_filetype )
530- let problem_file_name = printf (' %s.%s.%s' , problem_id,
530+ let problem_file_name = printf (' [DESC] %s.%s.%s' , problem_id,
531531 \ s: SlugToFileName (problem_slug),
532532 \ problem_ext)
533533
@@ -720,9 +720,19 @@ function! leetcode#ResetSolution(with_latest_submission) abort
720720 endfor
721721 call add (output, s: CommentEnd (filetype ))
722722 call append (' $' , output)
723-
724723 silent ! normal ! gggqG
725724
725+ let problem_ext = s: SolutionFileExt (g: leetcode_solution_filetype )
726+ " TODO avoid recalculation of problem_ext twice
727+ let problem_new_file_name = printf (' %s.%s.%s' , problem[' id' ], problem_slug, problem_ext)
728+ if buflisted (problem_file_name)
729+ execute bufnr (problem_new_file_name) . ' buffer'
730+ return
731+ endif
732+
733+ execute ' rightbelow new ' . problem_new_file_name
734+
735+
726736 call append (' $' , code)
727737
728738 silent ! normal ! ggdd
You can’t perform that action at this time.
0 commit comments