Use make_array to avoid specifying the array size

When I wrote this line I wanted to avoid adding the array size but
I didn't know about make_array().

I had unsuccessfully tried some alternatives, for example

	Array{"a", "b", "c"}

which doesn't work because we need StringView (c.f. git blame on
this line)

also

	Array<StringView>{"a", "b", "c"}

doesn't work because it's missing a template argument.
This commit is contained in:
Johannes Altmanninger 2022-08-01 11:22:30 +02:00
parent 08ea6d07e4
commit d324e506e3

View File

@ -1452,7 +1452,7 @@ KeymapMode parse_keymap_mode(StringView str, const KeymapManager::UserModeList&
return (KeymapMode)(std::distance(user_modes.begin(), it) + offset);
}
static constexpr Array<StringView, 8> modes = { "normal", "insert", "menu", "prompt", "goto", "view", "user", "object" };
static constexpr auto modes = make_array<StringView>({ "normal", "insert", "menu", "prompt", "goto", "view", "user", "object" });
const CommandDesc debug_cmd = {
"debug",