nil handling

This commit is contained in:
BirDt_ 2025-08-21 17:01:00 +08:00
parent 61409ef458
commit 549536ca05

View file

@ -55,7 +55,7 @@
(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 (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)))))
(add-hook 'tab-bar-select-tab-hook #'theurgy-swap-to-tab-project)