From 08ea6d07e4e5fcd7176a3cdacc18977e89115f4b Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 31 Jul 2022 10:17:43 +0200 Subject: [PATCH 1/2] Remove stale comment about StaticRegister Commit d470bd2cc (Make numeric registers setable, 2017-02-14) removed the user-provided StaticRegister::operator= in favor of a set() member function, so this comment is no longer valid. --- src/register_manager.hh | 1 - 1 file changed, 1 deletion(-) diff --git a/src/register_manager.hh b/src/register_manager.hh index 1fe8680b..2e760e6f 100644 --- a/src/register_manager.hh +++ b/src/register_manager.hh @@ -34,7 +34,6 @@ protected: }; // static value register, which can be modified -// using operator=, so should be user modifiable class StaticRegister : public Register { public: From d324e506e3ebf35e151a6e3efaed940280589757 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 1 Aug 2022 11:22:30 +0200 Subject: [PATCH 2/2] 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{"a", "b", "c"} doesn't work because it's missing a template argument. --- src/commands.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands.cc b/src/commands.cc index 46481b9d..d3843a8d 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -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 modes = { "normal", "insert", "menu", "prompt", "goto", "view", "user", "object" }; +static constexpr auto modes = make_array({ "normal", "insert", "menu", "prompt", "goto", "view", "user", "object" }); const CommandDesc debug_cmd = { "debug",