File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,10 +169,18 @@ namespace {
169169struct key_name_key_pair {
170170 std::string_view name;
171171 ruis::key key;
172+
173+ // This constructor is added to suppress clang-tidy to ask using designated initializers,
174+ // when constructing key_name_key_pair items in the array, because it looks clearer without them.
175+ constexpr key_name_key_pair (std::string_view name, ruis::key key) :
176+ name(name),
177+ key(key)
178+ {}
172179};
173180
174181constexpr auto key_name_to_key_ordered_mapping = []() constexpr {
175- // TODO: refactor to avoid listing key names again
182+ // utki::enum_array is used here just to set the array size to the number of keys in ruis::key enum,
183+ // so that we can be sure that all keys are listed in the mapping.
176184 utki::enum_array<key_name_key_pair, ruis::key> arr = {{{
177185 {" space" sv, ruis::key::space},
178186 {" enter" sv, ruis::key::enter},
You can’t perform that action at this time.
0 commit comments