branch: elpa/javelin
commit 2c384accad8df20bcf91c13ea2d21546a2facfe1
Merge: 7b64b701e46 5af07ea7fb9
Author: Otávio Schwanck dos Santos <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #9 from joncol/fix-project-root-bug
    
    Fix project root bug
---
 harpoon.el | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/harpoon.el b/harpoon.el
index 546fadba8a3..5acb46dd352 100644
--- a/harpoon.el
+++ b/harpoon.el
@@ -83,10 +83,7 @@
   "Get the project root."
   (cond
    ((eq harpoon-project-package 'projectile) (when (fboundp 
'projectile-project-root) (projectile-project-root)))
-   ((eq harpoon-project-package 'project) (replace-regexp-in-string "~/"
-                                                                    (concat 
(car (split-string
-                                                                               
   (shell-command-to-string "echo $HOME") "\n")) "/")
-                                                                    (when 
(fboundp 'project-root) (project-root (project-current)))))))
+   ((eq harpoon-project-package 'project) (expand-file-name (when (fboundp 
'project-root) (project-root (project-current)))))))
 
 (defun harpoon--current-file-directory ()
   "Return current directory path sanitized."
@@ -110,7 +107,7 @@
 
 (defun harpoon--get-project-name-for-project ()
   "Return projects name for project."
-  (let* ((splitted-project-path (split-string (car (last (project-current))) 
"/"))
+  (let* ((splitted-project-path (split-string (project-root (project-current)) 
"/"))
          (splitted-length (length splitted-project-path))
          (project-name (nth (- splitted-length 2) splitted-project-path)))
     project-name))

Reply via email to