emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/projectile 4247ac7717: [Fix #1835] Allow visiting existing


From: ELPA Syncer
Subject: [nongnu] elpa/projectile 4247ac7717: [Fix #1835] Allow visiting existing vterm buffer in other window (#1863)
Date: Tue, 19 Sep 2023 04:01:05 -0400 (EDT)

branch: elpa/projectile
commit 4247ac77173b6f92f28af04f5a72ff68de19f057
Author: Mohamad Taan <59320318+M-Taan@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    [Fix #1835] Allow visiting existing vterm buffer in other window (#1863)
---
 CHANGELOG.md  |  3 ++-
 projectile.el | 12 +++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2f2684cf30..170a36feea 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,9 +19,10 @@
 * [#1831](https://github.com/bbatsov/projectile/issues/1831): Enable the 
project.el integration only when `projectile-mode` is active.
 * [#1847](https://github.com/bbatsov/projectile/issues/1847): Use literal 
directory name casing when toggling between impl and test.
 
-### Bug fixed
+### Bugs fixed
 
 * Fix `fd` inserting color control sequences when used over tramp.
+* [#1835](https://github.com/bbatsov/projectile/issues/1835): Reopening 
existing vterm buffer in other window
 
 ## 2.7.0 (2022-11-22)
 
diff --git a/projectile.el b/projectile.el
index d6c6c24f5f..8b650ed5d5 100644
--- a/projectile.el
+++ b/projectile.el
@@ -4549,14 +4549,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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]