Skip to content

Commit

Permalink
X.A.DynamicProjects: Don't autodelete projects
Browse files Browse the repository at this point in the history
Fixes #902 by no longer deleting projects on switch, as it is more confusing than useful.
  • Loading branch information
jackroi authored and geekosaur committed Sep 4, 2024
1 parent b3c2494 commit c987156
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions XMonad/Actions/DynamicProjects.hs
Original file line number Diff line number Diff line change
Expand Up @@ -255,20 +255,7 @@ modifyProject f = do
--------------------------------------------------------------------------------
-- | Switch to the given project.
switchProject :: Project -> X ()
switchProject p = do
oldws <- gets (W.workspace . W.current . windowset)
oldp <- currentProject

let name = W.tag oldws
ws = W.integrate' (W.stack oldws)

-- If the project we are switching away from has no windows, and
-- it's a dynamic project, remove it from the configuration.
when (null ws && isNothing (projectStartHook oldp)) $ do
removeWorkspaceByTag name -- also remove the old workspace
XS.modify (\s -> s {projects = Map.delete name $ projects s})

appendWorkspace (projectName p)
switchProject p = appendWorkspace (projectName p)

--------------------------------------------------------------------------------
-- | Prompt for a project name and then switch to it. Automatically
Expand Down

0 comments on commit c987156

Please sign in to comment.