From 722f5a2e18b77553443a9316eaa51a7b9575f13c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 6 May 2025 00:26:27 -0400 Subject: [PATCH] fix(workspaces): use existing workspace on project switch A "workspace already exists" error is thrown if trying to switch to project workspace that already exists. This changes it to switch to the workspace instead. Fix: #8368 --- modules/ui/workspaces/autoload/workspaces.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ui/workspaces/autoload/workspaces.el b/modules/ui/workspaces/autoload/workspaces.el index ce27cbb2a..b83f1784d 100644 --- a/modules/ui/workspaces/autoload/workspaces.el +++ b/modules/ui/workspaces/autoload/workspaces.el @@ -583,7 +583,9 @@ This be hooked to `projectile-after-switch-project-hook'." proot)))) (push (pop pre) post)) (unless pre ws)))) - (ws (or ws (+workspace-new pname)))) + (ws (or ws + (+workspace-get pname t) + (+workspace-new pname)))) (set-persp-parameter ws-param proot ws) (+workspace-switch pname) (with-current-buffer (doom-fallback-buffer)