Skip to content

Commit da2ff9b

Browse files
akreisherkaiwk
authored andcommitted
Fix leetcode-show-problem outside of the problems table
1 parent b0c466f commit da2ff9b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

leetcode.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,8 @@ Get problem by id and use `shr-render-buffer' to render problem
11751175
detail. This action will show the detail in other window and jump
11761176
to it."
11771177
(interactive (list (read-string "Show problem by problem id: "
1178-
(leetcode--get-current-problem-id))))
1178+
(when (derived-mode-p 'leetcode--problems-mode)
1179+
(leetcode--get-current-problem-id)))))
11791180
(let* ((problem (leetcode--get-problem-by-id problem-id))
11801181
(title-slug (leetcode-problem-title-slug problem))
11811182
(problem-with-title (aio-await (leetcode--ensure-question-title problem)))

0 commit comments

Comments
 (0)