Skip to content

Commit

Permalink
enter insert mode on double space
Browse files Browse the repository at this point in the history
  • Loading branch information
aprxi committed Aug 4, 2024
1 parent faa4d3f commit 2ebafe6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ pub fn handle_prompt_window_event(
'-' => {
app_ui.set_primary_window(WindowKind::ResponseWindow);
}
' ' => {
if let Some(prev) = key_track.previous_key_str() {
if prev == " " {
// change to insert mode if double space
return Ok(Some(app_ui.set_prompt_window(true)));
}
}
}
_ => {}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ impl KeyTrack {
}
match new_c {
' ' => {
self.previous_key_str = Some(String::new());
// double space
self.set_leader_key(false);
}
'i' => {
// currently insert always disables leader key
Expand Down

0 comments on commit 2ebafe6

Please sign in to comment.