Skip to content

Commit

Permalink
[Fix bbatsov#1835] Reopening existing vterm buffer in other window
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Taan committed Sep 16, 2023
1 parent 971cd5c commit 9fa0b76
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -4528,14 +4528,16 @@ be displayed in a different window.
Switch to the project specific term buffer if it already exists."
(let* ((project (projectile-acquire-root))
(buffer (projectile-generate-process-name "vterm" new-process project)))
(unless (buffer-live-p (get-buffer buffer))
(unless (require 'vterm nil 'noerror)
(error "Package 'vterm' is not available"))
(unless (require 'vterm nil 'noerror)
(error "Package 'vterm' is not available"))
(if (buffer-live-p (get-buffer buffer))
(if other-window
(switch-to-buffer-other-window buffer)
(switch-to-buffer buffer))
(projectile-with-default-dir project
(if other-window
(vterm-other-window buffer)
(vterm buffer))))
(switch-to-buffer buffer)))
(vterm buffer))))))

;;;###autoload
(defun projectile-run-vterm (&optional arg)
Expand Down

0 comments on commit 9fa0b76

Please sign in to comment.