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

@ -109,10 +109,10 @@ void cmd_workspace_back_and_forth(I3_CMD);
void cmd_workspace_name(I3_CMD, char *name);
/**
* Implementation of 'mark <mark>'
* Implementation of 'mark [--toggle] <mark>'
*
*/
void cmd_mark(I3_CMD, char *mark);
void cmd_mark(I3_CMD, char *mark, char *toggle);
/**
* Implementation of 'unmark [mark]'