mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
Merge pull request #503 from oogeek/X.L.Rename-KeepWordsLR
add KeepWordsLeft and KeepWordsRight for X.L.Renamed
This commit is contained in:
commit
a668b0f13a
@ -529,6 +529,11 @@
|
||||
ability to postpone magnifying until there are a certain number of
|
||||
windows on the workspace.
|
||||
|
||||
* `XMonad.Layout.Renamed`
|
||||
|
||||
- Added `KeepWordsLeft` and `KeepWordsRight` for keeping certain number of
|
||||
words in left or right direction in layout description.
|
||||
|
||||
## 0.16
|
||||
|
||||
### Breaking Changes
|
||||
|
@ -46,6 +46,8 @@ data Rename a = CutLeft Int -- ^ Remove a number of characters from the left
|
||||
| Prepend String -- ^ Add a string on the left
|
||||
| CutWordsLeft Int -- ^ Remove a number of words from the left
|
||||
| CutWordsRight Int -- ^ Remove a number of words from the right
|
||||
| KeepWordsLeft Int -- ^ Keep a number of words from the left
|
||||
| KeepWordsRight Int -- ^ Keep a number of words from the right
|
||||
| AppendWords String -- ^ Add a string to the right, prepending a space to it
|
||||
-- if necessary
|
||||
| PrependWords String -- ^ Add a string to the left, appending a space to it if
|
||||
@ -60,6 +62,9 @@ apply (CutRight i) s = take (length s - i) s
|
||||
apply (CutWordsLeft i) s = unwords $ drop i $ words s
|
||||
apply (CutWordsRight i) s = let ws = words s
|
||||
in unwords $ take (length ws - i) ws
|
||||
apply (KeepWordsLeft i) s = unwords $ take i $ words s
|
||||
apply (KeepWordsRight i) s = let ws = words s
|
||||
in unwords $ drop (length ws - i) ws
|
||||
apply (Replace s) _ = s
|
||||
apply (Append s') s = s ++ s'
|
||||
apply (Prepend s') s = s' ++ s
|
||||
|
Loading…
x
Reference in New Issue
Block a user