save selected window
This commit is contained in:
parent
549536ca05
commit
8592cb0134
1 changed files with 4 additions and 2 deletions
|
@ -50,13 +50,15 @@
|
||||||
(find-file (get-project-default-file dir))
|
(find-file (get-project-default-file dir))
|
||||||
(tab-rename (file-name-nondirectory (string-remove-suffix "/" 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
|
(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 ()
|
(defun theurgy-swap-to-tab-project ()
|
||||||
"Go to the project dir of the tab group."
|
"Go to the project dir of the tab group."
|
||||||
(let ((tab-group-name (tab-bar-tab-group-default (tab-bar--current-tab))))
|
(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))
|
(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)
|
(add-hook 'tab-bar-select-tab-hook #'theurgy-swap-to-tab-project)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue