Skip to content

Hashmap in Config unnecessary? #14752

@Wuketuke

Description

@Wuketuke

why does Config use a hashmap for the different modes? Since Mode is an enum with 3 variants, a [KeyTrie; 3] might be better.
(or a struct that wraps said array)

#[derive(Debug, Clone, PartialEq)]
pub struct Config {
    pub theme: Option<theme::Config>,
    pub keys: HashMap<Mode, KeyTrie>, // why use a hashmap?
    pub editor: helix_view::editor::Config,
}

heres the Mode enum

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum Mode {
    Normal = 0,
    Select = 1,
    Insert = 2,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions