branch: externals/window-commander
commit dbe46d5b86b18ad73872a03fec65f260b9d2989d
Author: Daniel Semyonov <cm...@dsemy.com>
Commit: Daniel Semyonov <cm...@dsemy.com>

    * swsw.el (swsw-select): Don't select the next window for non-existent IDs
---
 swsw.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/swsw.el b/swsw.el
index 7be57ed680..5a8d542245 100644
--- a/swsw.el
+++ b/swsw.el
@@ -221,7 +221,8 @@ This command is intended to be used only when ‘swsw-mode’ 
is enabled."
                      (swsw--read-id (swsw--get-id-length))
                    (run-hooks 'swsw-after-select-hook))))
   (let ((window (cdr (assoc id swsw-window-list))))
-    (select-window (if window window (next-window)))))
+    (select-window (if window window
+                     (if id (selected-window) (next-window))))))
 
 ;;;###autoload
 (define-minor-mode swsw-mode

Reply via email to