Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
0xGingi committed Sep 30, 2024
1 parent f89f673 commit 01c9277
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ impl Keybindings {
("Ctrl+w".to_string(), "close_tab".to_string()),
("Ctrl+Shift+Tab".to_string(), "previous_tab".to_string()),
("Ctrl+m".to_string(), "toggle_minimap".to_string()),
("Cmd+M".to_string(), "toggle_minimap".to_string()),
].iter().cloned().collect(),
insert_mode: [
("Esc".to_string(), "exit_insert_mode".to_string()),
Expand Down Expand Up @@ -832,13 +831,10 @@ impl Editor {
if key.modifiers.contains(KeyModifiers::SHIFT) {
key_string.push_str("Shift+");
}
if key.modifiers.contains(KeyModifiers::SUPER) {
key_string.push_str("Cmd+");
}
match key.code {
KeyCode::Char(c) => {
if key.modifiers.contains(KeyModifiers::CONTROL) || key.modifiers.contains(KeyModifiers::SUPER) {
key_string.push(c.to_ascii_uppercase());
if key.modifiers.contains(KeyModifiers::CONTROL) {
key_string.push(c.to_ascii_lowercase());
} else {
key_string.push(c);
}
Expand Down Expand Up @@ -1007,10 +1003,8 @@ impl Editor {
fn handle_key_event(&mut self, key: KeyEvent) -> io::Result<bool> {
let _key_str = Self::key_event_to_string(key);

if (key.modifiers.contains(KeyModifiers::CONTROL) || key.modifiers.contains(KeyModifiers::SUPER))
&& (key.code == KeyCode::Char('m') || key.code == KeyCode::Char('M'))
{
self.debug_messages.push("Ctrl+M or Cmd+M detected, toggling minimap".to_string());
if key.modifiers.contains(KeyModifiers::CONTROL) && key.code == KeyCode::Char('m') {
self.debug_messages.push("Ctrl+M detected, toggling minimap".to_string());
return self.toggle_minimap();
}

Expand Down

0 comments on commit 01c9277

Please sign in to comment.