From 8592cb0134796cd275ad3534b4a517e420317bca Mon Sep 17 00:00:00 2001 From: BirDt_ Date: Thu, 21 Aug 2025 17:02:00 +0800 Subject: [PATCH] save selected window --- userland/projects.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/userland/projects.el b/userland/projects.el index 124a9f0..23e92b3 100644 --- a/userland/projects.el +++ b/userland/projects.el @@ -50,13 +50,15 @@ (find-file (get-project-default-file dir)) (tab-rename (file-name-nondirectory (string-remove-suffix "/" dir))) (tab-bar-change-tab-group (concat "project: " dir)) ;; We use the tab group name to store the project working directory - (neotree-dir dir)))) + (save-selected-window + (neotree-dir dir))))) (defun theurgy-swap-to-tab-project () "Go to the project dir of the tab group." (let ((tab-group-name (tab-bar-tab-group-default (tab-bar--current-tab)))) (when (and tab-group-name (string-match-p "^project:" tab-group-name)) - (neotree-dir (string-remove-prefix "project: " tab-group-name))))) + (save-selected-window + (neotree-dir (string-remove-prefix "project: " tab-group-name)))))) (add-hook 'tab-bar-select-tab-hook #'theurgy-swap-to-tab-project)