Skip to content

Conversation

@Praaa181203
Copy link

Added key maps in config.

@Praaa181203 Praaa181203 reopened this Dec 29, 2023
src/key.rs Outdated
#[serde(default)]
pub struct KeyMap {
#[serde(deserialize_with = "deseralize_key")]
pub remove_previous_word: Option<Key>,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be named delete_word and delete_char. Ctrl-Backspace usually removes the current word.

Copy link
Author

@Praaa181203 Praaa181203 Jan 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually Ctrl+Backspace, removes the word (part of the word if the cursor is between the word) before the cursor, that's why i chose it to name it remove_previous_word. In my opinion delete_word would somewhat be misleading, because delete_word indicates the its deleting the whole word, but instead it removes the word before the cursor.

}

fn get_key_modifier_from_string(string: &str) -> KeyModifiers {
match string {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably be good to support non-abbreviated modifiers for each of these also. For example, "Ctrl", "Alt", etc. Some people also call the Meta key "Super" or "Win".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not quite understand this?
Should I allow "Ctrl-Backspace" as an option for config?
And Meta and Super are seperate modifiers, so i dont quite get what you mean.

"W" => KeyModifiers::SUPER,
"H" => KeyModifiers::HYPER,
"M" => KeyModifiers::META,
_ => KeyModifiers::NONE,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An unknown modifier should probably be an error, not a silent fallback to no modifier.

@Praaa181203
Copy link
Author

@max-niederman thanks for the requested changes, i am new to rust, and i will work on these as soon as possible!!

@Praaa181203
Copy link
Author

@max-niederman I have made the changes, can you resolve the doubts i have?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants