Introduce special value __focused__ for criterion con_id.
This allows matching with [con_id=__focused__] unmark for commands that do not default to operating on the focused window if no criteria have been specified (such as unmark). relates to #2014
This commit is contained in:
@ -91,6 +91,27 @@ is_deeply(get_mark_for_window_on_workspace($ws, $con), [ 'A', 'B', 'C' ], 'match
|
||||
|
||||
cmd 'unmark';
|
||||
|
||||
###############################################################################
|
||||
# Verify that "unmark" can be matched on the focused window.
|
||||
###############################################################################
|
||||
|
||||
$ws = fresh_workspace;
|
||||
$con = open_window;
|
||||
cmd 'mark --add A';
|
||||
cmd 'mark --add B';
|
||||
open_window;
|
||||
cmd 'mark --add C';
|
||||
cmd 'mark --add D';
|
||||
|
||||
is_deeply(sort(get_marks()), [ 'A', 'B', 'C', 'D' ], 'all marks exist');
|
||||
|
||||
cmd '[con_id=__focused__] unmark';
|
||||
|
||||
is_deeply(sort(get_marks()), [ 'A', 'B' ], 'marks on the unfocused window still exist');
|
||||
is_deeply(get_mark_for_window_on_workspace($ws, $con), [ 'A', 'B' ], 'matching on con_id=__focused__ works for unmark');
|
||||
|
||||
cmd 'unmark';
|
||||
|
||||
###############################################################################
|
||||
|
||||
done_testing;
|
||||
|
Reference in New Issue
Block a user