mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
X.A.WorkspaceNames: Use history for completion in renameWorkspace
This commit is contained in:
parent
348df92b89
commit
6912eca829
@ -248,6 +248,10 @@
|
||||
- Added `orIfPrefixed`, a combinator to decide upon an action based
|
||||
on whether any prefix argument was given.
|
||||
|
||||
* `XMonad.Actions.WorkspaceNames`
|
||||
|
||||
- Enabled prompt completion (from history) in `renameWorkspace`.
|
||||
|
||||
### Other changes
|
||||
|
||||
## 0.17.1 (September 3, 2022)
|
||||
|
@ -51,7 +51,7 @@ import XMonad.Actions.CycleWS (findWorkspace, WSType(..), Direction1D(..), anyWS
|
||||
import qualified XMonad.Actions.SwapWorkspaces as Swap
|
||||
import XMonad.Hooks.StatusBar.PP (PP(..))
|
||||
import XMonad.Hooks.EwmhDesktops (addEwmhWorkspaceRename)
|
||||
import XMonad.Prompt (mkXPrompt, XPConfig)
|
||||
import XMonad.Prompt (mkXPrompt, XPConfig, historyCompletionP)
|
||||
import XMonad.Prompt.Workspace (Wor(Wor))
|
||||
import XMonad.Util.WorkspaceCompare (getSortByIndex)
|
||||
|
||||
@ -137,9 +137,11 @@ setCurrentWorkspaceName name = do
|
||||
|
||||
-- | Prompt for a new name for the current workspace and set it.
|
||||
renameWorkspace :: XPConfig -> X ()
|
||||
renameWorkspace conf =
|
||||
mkXPrompt pr conf (const (return [])) setCurrentWorkspaceName
|
||||
where pr = Wor "Workspace name: "
|
||||
renameWorkspace conf = do
|
||||
completion <- historyCompletionP (prompt ==)
|
||||
mkXPrompt (Wor prompt) conf completion setCurrentWorkspaceName
|
||||
where
|
||||
prompt = "Workspace name: "
|
||||
|
||||
-- | See 'XMonad.Actions.SwapWorkspaces.swapTo'. This is the same with names.
|
||||
swapTo :: Direction1D -> X ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user