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:
parent
08ea6d07e4
commit
d324e506e3
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue
Block a user