File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -640,6 +640,10 @@ following possible value:
640
640
(leetcode--show-submission-result res)
641
641
(leetcode--loading-mode -1 )))))))))
642
642
643
+ (defun leetcode--problem-link (title )
644
+ " Generate problem link from title."
645
+ (concat leetcode--base-url " /problems/" (leetcode--slugify-title title)))
646
+
643
647
(defun leetcode-show-description ()
644
648
" Show current entry problem description.
645
649
Get current entry by using `tabulated-list-get-entry' and use
@@ -676,7 +680,12 @@ Get current entry by using `tabulated-list-get-entry' and use
676
680
title
677
681
(append .codeSnippets nil )
678
682
.sampleTestCase))
679
- 'help-echo " solve the problem." ))
683
+ 'help-echo " solve the problem." )
684
+ (insert (make-string 4 ?\s ))
685
+ (insert-text-button " link"
686
+ 'action (lambda (btn )
687
+ (browse-url (leetcode--problem-link title)))
688
+ 'help-echo " open the problem in browser." ))
680
689
(rename-buffer buf-name)
681
690
(leetcode--problem-description-mode)
682
691
(switch-to-buffer (current-buffer ))))))
You can’t perform that action at this time.
0 commit comments