Skip to content

Commit

Permalink
feat: accepting capital letters in insert mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wllfaria committed May 9, 2024
1 parent 4dc3c81 commit 7e82ebb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
Binary file modified extra/examples/editor.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 21 additions & 15 deletions extra/examples/editor.tape
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ Hide
Sleep 3s
Show
Sleep 1s
Type "j"
Sleep 1s
Type@500ms "jj"
Sleep 1s
Type@500ms "kk"
Enter
Sleep 1s
Sleep 500ms
Type@200ms "jj"
Enter
Sleep 3s
Tab
Sleep 1s
Enter
Expand All @@ -41,8 +39,14 @@ Tab
Sleep 0.5s
Enter
Sleep 1s
Type@100ms "jjjjjjjjjj"
Sleep 1s
Tab
Sleep 1s
Tab
Sleep 1s
Type@100ms "jjjjjjjjjj"
Sleep 1s
Escape
Sleep 1s
Tab
Expand All @@ -52,23 +56,25 @@ Sleep 0.5s
Tab
Sleep 0.5s
Enter
Type@100ms "jllllllllllllllllllllll"
Type@100ms "WWWWWW"
Sleep 1s
Type "i"
Sleep 1s
Backspace
Sleep 0.5s
Sleep 0.1s
Backspace
Sleep 0.5s
Sleep 0.1s
Backspace
Sleep 0.5s
Sleep 0.1s
Backspace
Sleep 0.5s
Sleep 0.1s
Backspace
Sleep 0.5s
Sleep 0.1s
Backspace
Sleep 0.5s
Sleep 0.1s
Backspace
Sleep 0.5s
Type@100ms "hello_"
Sleep 0.1s
Type@100ms "Hello "
Sleep 0.2s
Escape
Sleep 3s
2 changes: 1 addition & 1 deletion tui/src/components/api_explorer/req_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ impl Eventful for ReqEditor<'_> {
key_event: KeyEvent,
) -> anyhow::Result<Option<reqtui::command::Command>> {
match (&self.editor_mode, key_event.code, key_event.modifiers) {
(EditorMode::Insert, KeyCode::Char(c), KeyModifiers::NONE) => {
(EditorMode::Insert, KeyCode::Char(c), _) => {
self.body.insert_char(c, &self.cursor);
self.cursor.move_right(1);
}
Expand Down

0 comments on commit 7e82ebb

Please sign in to comment.