Skip to content

Commit

Permalink
Merge pull request #16 from tsoding/vim
Browse files Browse the repository at this point in the history
Make controls more vim-ish
  • Loading branch information
rexim authored Jun 23, 2021
2 parents 8e90a0c + 4025712 commit d79b2c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ $ cargo run TODO

|Keys|Description|
|---|---|
|<kbd>w</kbd>, <kbd>s</kbd>|Move up and down|
|<kbd>Shift+W</kbd>, <kbd>Shift+S</kbd>|Drag the current item up and down|
|<kbd>k</kbd>, <kbd>j</kbd>|Move cursor up and down|
|<kbd>Shift+K</kbd>, <kbd>Shift+J</kbd>|Drag the current item up and down|
|<kbd>q</kbd>|Quit|
|<kbd>TAB</kbd>|Switch between the TODO and DONE panels|
|<kbd>Enter</kbd>|Perform an action on the highlighted UI element|
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,19 +372,19 @@ fn main() {
let key = getch();
match key as u8 as char {
'q' => quit = true,
'W' => match panel {
'K' => match panel {
Status::Todo => list_drag_up(&mut todos, &mut todo_curr),
Status::Done => list_drag_up(&mut dones, &mut done_curr),
},
'S' => match panel {
'J' => match panel {
Status::Todo => list_drag_down(&mut todos, &mut todo_curr),
Status::Done => list_drag_down(&mut dones, &mut done_curr),
},
'w' => match panel {
'k' => match panel {
Status::Todo => list_up(&mut todo_curr),
Status::Done => list_up(&mut done_curr),
},
's' => match panel {
'j' => match panel {
Status::Todo => list_down(&todos, &mut todo_curr),
Status::Done => list_down(&dones, &mut done_curr),
},
Expand Down

0 comments on commit d79b2c5

Please sign in to comment.