Skip to content

Commit

Permalink
make toggle-harpoon-file actually toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
emillenz committed Nov 21, 2024
1 parent 55f3d50 commit 4b2331c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion harpoon.el
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,10 @@ Select items to delete:
(defun harpoon-toggle-file ()
"Open harpoon file."
(interactive)
(unless (eq major-mode 'harpoon-mode)
(if (eq major-mode 'harpoon-mode)
(progn
(save-buffer)
(switch-to-buffer (other-buffer)))
(harpoon--create-directory)
(setq harpoon--current-project-path (when (harpoon--has-project) (harpoon-project-root-function)))
(find-file (harpoon--file-name) '(:dedicated t))
Expand Down

0 comments on commit 4b2331c

Please sign in to comment.