Don't auto-delete workspaces

* Previously I was removing empty workspaces after switching away from
    them, but this seemed to cause a bug when workspaces were defined
    statically in your XMonad configuration.

  * Next up: a function to delete an existing project.
This commit is contained in:
Peter Jones 2015-12-02 20:07:37 -07:00
parent ea8e0ea7b6
commit f35083da9f

View File

@ -76,13 +76,13 @@ import qualified XMonad.Util.ExtensibleState as XS
-- or further configure the workspace/project. -- or further configure the workspace/project.
-- --
-- When using the @switchProjectPrompt@ function, workspaces are -- When using the @switchProjectPrompt@ function, workspaces are
-- created and deleted as necessary. This means you can create new -- created as needed. This means you can create new project spaces
-- project spaces on the fly as needed. (These dynamic projects are -- (and therefore workspaces) on the fly. (These dynamic projects are
-- not preserved across restarts.) -- not preserved across restarts.)
-- --
-- Additionally, frequently used projects can be configured statically -- Additionally, frequently used projects can be configured statically
-- in your XMonad configuration. Doing so allows you to configure the -- in your XMonad configuration. Doing so allows you to configure the
-- start-up hook. -- per-project start-up hook.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- $usage -- $usage
@ -213,10 +213,7 @@ switchProject p = do
when (null ws && isNothing (projectStartHook oldp)) $ when (null ws && isNothing (projectStartHook oldp)) $
XS.modify (\s -> s {projects = Map.delete name $ projects s}) XS.modify (\s -> s {projects = Map.delete name $ projects s})
-- Remove the old workspace (if empty) and activate the new appendWorkspace (projectName p)
-- workspace. The project will be activated by the log hook.
removeEmptyWorkspace
addWorkspace (projectName p)
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- | Prompt for a project name and then switch to it. Automatically -- | Prompt for a project name and then switch to it. Automatically