-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rules: Add support for :all qualifier
Some layout options require to be applied to every group to maintain consistency (e.g. a group switcher). Currently this must be done manually for all layout indexes. This is error prone and prevents the increase of the maximum group count. This commit introduces the `:all` qualifier for KcCGST values. When a rule with this qualifier is matched, it will expands the qualified value (and its optional merge mode) for every layout, e.g. `+group(toggle):all` (respectively `|group(toggle)`) would expand to `+group(toggle):1+group(toggle):2` (respectively `|group(toggle):1|group(toggle):2`) if there are 2 layouts, etc. If there is no merge mode, it defaults to *override* `+`, e.g. `x:all` expands to `x:1+x:2+x:3` for 3 layouts. Note that only the qualified *value* is expanded, e.g. `x+y:all` expands to `x+y:1+y:2` for 2 layouts. `:all` can be used in combination with special layout indexes. Since this can lead to an unexpected behaviour, a warning will be raised.
- Loading branch information
Showing
8 changed files
with
370 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
! model = keycodes | ||
my_model = my_keycodes | ||
* = default_keycodes | ||
|
||
! layout variant = symbols | ||
layout_a my_variant = symbols_a+extra_variant | ||
|
||
! layout = symbols | ||
layout_a = symbols_a | ||
layout_b = symbols_b | ||
* = default_symbols | ||
|
||
! layout[1] = symbols | ||
layout_a = symbols_a:1 | ||
layout_b = symbols_b:1 | ||
layout_x = base:all // strange but valid | ||
* = default_symbols:1 | ||
|
||
! layout[2] = symbols | ||
layout_a = +symbols_a:2 | ||
layout_b = +symbols_b:2 | ||
* = +default_symbols:2 | ||
|
||
! layout[3] = symbols | ||
layout_a = +symbols_a:3 | ||
layout_b = +symbols_b:3 | ||
* = +default_symbols:3 | ||
|
||
! layout[4] = symbols | ||
layout_a = +symbols_a:4 | ||
layout_b = +symbols_b:4 | ||
* = +default_symbols:4 | ||
|
||
// WARNING: Invalid at the moment. Here for future test | ||
! layout[5] = symbols | ||
layout_a = +symbols_a:5 | ||
layout_b = +symbols_b:5 | ||
layout_c = +symbols_c:5 | ||
* = +default_symbols:5 | ||
|
||
// Combine with special indexes | ||
! layout[first] variant[first] = symbols | ||
* extra1 = +extra_symbols:all | ||
|
||
// Combine with special indexes (valid but raises a warning) | ||
! layout[any] variant[any] = symbols | ||
* extra2 = +extra_symbols1:%i+extra_symbols2:all | ||
* extra3 = +extra_symbols2:all+extra_symbols1:%i | ||
|
||
! model = types | ||
my_model = my_types | ||
* = default_types | ||
|
||
! model = compat | ||
my_model = my_compat | ||
* = default_compat | ||
|
||
! option = symbols | ||
my_option = +extra_option:all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
! model = keycodes | ||
* = default_keycodes | ||
|
||
! layout[1] = symbols | ||
* = x:all // force x on all groups | ||
|
||
! layout[later] = symbols | ||
// skipped, as it has no explicit merge mode and | ||
// thus is not appended to previous | ||
* = skip | ||
|
||
! model = types | ||
* = default_types | ||
|
||
! model = compat | ||
* = default_compat | ||
|
||
! option = symbols |
Oops, something went wrong.