Tweak keymap_manager style, fix missing move
This commit is contained in:
parent
ebecd60eb8
commit
e0c452adb6
|
@ -6,9 +6,9 @@
|
||||||
namespace Kakoune
|
namespace Kakoune
|
||||||
{
|
{
|
||||||
|
|
||||||
void KeymapManager::map_key(Key key, KeymapMode mode, std::vector<Key> mapping)
|
void KeymapManager::map_key(Key key, KeymapMode mode, KeyList mapping)
|
||||||
{
|
{
|
||||||
m_mapping[{key, mode}] = mapping;
|
m_mapping[{key, mode}] = std::move(mapping);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeymapManager::unmap_key(Key key, KeymapMode mode)
|
void KeymapManager::unmap_key(Key key, KeymapMode mode)
|
||||||
|
|
|
@ -29,7 +29,8 @@ class KeymapManager
|
||||||
public:
|
public:
|
||||||
KeymapManager(KeymapManager& parent) : m_parent(&parent) {}
|
KeymapManager(KeymapManager& parent) : m_parent(&parent) {}
|
||||||
|
|
||||||
void map_key(Key key, KeymapMode mode, std::vector<Key> mapping);
|
using KeyList = std::vector<Key>;
|
||||||
|
void map_key(Key key, KeymapMode mode, KeyList mapping);
|
||||||
void unmap_key(Key key, KeymapMode mode);
|
void unmap_key(Key key, KeymapMode mode);
|
||||||
|
|
||||||
bool is_mapped(Key key, KeymapMode mode) const;
|
bool is_mapped(Key key, KeymapMode mode) const;
|
||||||
|
@ -42,7 +43,6 @@ private:
|
||||||
|
|
||||||
KeymapManager* m_parent;
|
KeymapManager* m_parent;
|
||||||
|
|
||||||
using KeyList = std::vector<Key>;
|
|
||||||
using KeyAndMode = std::pair<Key, KeymapMode>;
|
using KeyAndMode = std::pair<Key, KeymapMode>;
|
||||||
using Keymap = UnorderedMap<KeyAndMode, KeyList>;
|
using Keymap = UnorderedMap<KeyAndMode, KeyList>;
|
||||||
Keymap m_mapping;
|
Keymap m_mapping;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user