Added a --toggle switch to "mark [--toggle] <mark>"

This option allows toggling marks on a window without knowing whether the mark is already set or not.
It behaves as follows:
1) If the matched window has no mark, the new mark is set.
2) If the matched window has another mark, the old mark is removed and the new mark is set.
3) If the matched window already has the mark, the mark is removed.

The behavior that all non-matched windows have this mark removed is kept.

fixes #1463
This commit is contained in:
Ingo Bürk
2015-03-28 19:12:25 +01:00
parent dfefb10d36
commit d51d6d730e
3 changed files with 34 additions and 18 deletions

View File

@ -189,10 +189,12 @@ state FLOATING:
floating = 'enable', 'disable', 'toggle'
-> call cmd_floating($floating)
# mark <mark>
# mark [--toggle] <mark>
state MARK:
toggle = '--toggle'
->
mark = string
-> call cmd_mark($mark)
-> call cmd_mark($mark, $toggle)
# unmark [mark]
state UNMARK: