Skip to content

Commit

Permalink
improve(segments,project): include project name in help echo
Browse files Browse the repository at this point in the history
  • Loading branch information
Walheimat committed Nov 2, 2024
1 parent f862b23 commit 8afb810
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/whale-line-segments-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -708,9 +708,10 @@

(ert-deftest project--help ()
(bydi ((:always project-current)
(:mock project-name :return "Test")
(:mock project-root :return "/home/test/project/"))

(should (string= "Project (/home/test/project/)\nmouse-1: Open root" (whale-line-segments--project--help)))))
(should (string= "Project Test (/home/test/project/)\nmouse-1: Open root" (whale-line-segments--project--help)))))

(ert-deftest project--get--for-project ()
(let ((whale-line-segments--project--map nil)
Expand Down
3 changes: 2 additions & 1 deletion whale-line-segments.el
Original file line number Diff line number Diff line change
Expand Up @@ -888,9 +888,10 @@ Only consider Dired buffers and file buffers."
(defun whale-line-segments--project--help ()
"Get the help text for the project."
(when-let* ((project (project-current))
(name (project-name project))
(root (project-root project)))

(format "Project (%s)\nmouse-1: Open root" root)))
(format "Project %s (%s)\nmouse-1: Open root" name root)))

(defun whale-line-segments--project ()
"Get the project segment."
Expand Down

0 comments on commit 8afb810

Please sign in to comment.