Update some git agnostic binds to be up front
- SHA
a3813f4f0492dc93a648b6ff17006af0c9fc4411- Parents
-
afbecfa - Tree
9126982
a3813f4
a3813f4f0492dc93a648b6ff17006af0c9fc4411afbecfa
9126982| Status | File | + | - |
|---|---|---|---|
| M |
src/display_module.f90
|
2 | 2 |
| M |
src/fuss_main.f90
|
24 | 6 |
src/display_module.f90modified@@ -183,14 +183,14 @@ contains | ||
| 183 | 183 | achar(27) // '[31m✗' // achar(27) // '[0m=modified ' // & |
| 184 | 184 | achar(27) // '[90m✗' // achar(27) // '[0m=untracked ' // & |
| 185 | 185 | achar(27) // '[34m↓' // achar(27) // '[0m=incoming' // achar(27) // '[0m' |
| 186 | - print '(A)', achar(27) // '[33mKeys: j/k/↑/↓:nav | ←/→:nav tree | space:toggle | .:hide-dots | a:stage | u:unstage | S:stage-all | U:unstage-all | x:discard | z:stash | Z:unstash | b:switch | n:new-br | R:del-br | G:merge | O:reset | I:rebase | f:fetch | d:diff | c:view | w:blame | h:history | L:reflog | y:cherry-pick | v:revert | r:delete | l:pull | m:commit | M:amend | p:push | t:tag | s:status | q:exit-mode | ESC:exit-mode | ctrl-c:quit' // achar(27) // '[0m' | |
| 186 | + print '(A)', achar(27) // '[33mKeys: j/k/↑/↓:nav | ←/→:nav tree | space:toggle | .:hide-dots | a:stage | u:unstage | S:stage-all | U:unstage-all | x:discard | z:stash | Z:unstash | b:switch | n:new-br | R:del-br | G:merge | O:reset | I:rebase | f:fetch | d:diff | c/alt-v:view | w:blame | h:history | L:reflog | y:cherry-pick | v:revert | r:delete | l:pull | m:commit | M:amend | p:push | t:tag | s/alt-s:status | q:exit-mode | ESC:exit-mode | ctrl-c:quit' // achar(27) // '[0m' | |
| 187 | 187 | else |
| 188 | 188 | ! Normal mode help |
| 189 | 189 | print '(A)', 'Legend: ' // achar(27) // '[32m↑' // achar(27) // '[0m=staged ' // & |
| 190 | 190 | achar(27) // '[31m✗' // achar(27) // '[0m=modified ' // & |
| 191 | 191 | achar(27) // '[90m✗' // achar(27) // '[0m=untracked ' // & |
| 192 | 192 | achar(27) // '[34m↓' // achar(27) // '[0m=incoming' |
| 193 | - print '(A)', 'Keys: j/k/↑/↓:nav | ←/→:nav tree | space:toggle | .:hide-dots | alt-g:git-mode | ctrl-c:quit' | |
| 193 | + print '(A)', 'Keys: j/k/↑/↓:nav | ←/→:nav tree | space:toggle | .:hide-dots | alt-v:view | alt-s:status | alt-g:git-mode | ctrl-c:quit' | |
| 194 | 194 | end if |
| 195 | 195 | |
| 196 | 196 | ! Don't free tree - it's owned by interactive_mode |
src/fuss_main.f90modified@@ -349,6 +349,24 @@ contains | ||
| 349 | 349 | cycle ! Skip rest of key handling |
| 350 | 350 | end if |
| 351 | 351 | |
| 352 | + ! Check for alt-s to show git status (available in both modes) | |
| 353 | + ! alt-s is encoded as achar(1 + ichar('s') - ichar('a')) = achar(19) | |
| 354 | + if (key == achar(19)) then | |
| 355 | + call show_status_view() | |
| 356 | + needs_full_redraw = .true. | |
| 357 | + cycle | |
| 358 | + end if | |
| 359 | + | |
| 360 | + ! Check for alt-v to view file (available in both modes) | |
| 361 | + ! alt-v is encoded as achar(1 + ichar('v') - ichar('a')) = achar(22) | |
| 362 | + if (key == achar(22)) then | |
| 363 | + if (items(selected)%is_file) then | |
| 364 | + call view_file(items(selected)%path) | |
| 365 | + needs_full_redraw = .true. | |
| 366 | + end if | |
| 367 | + cycle | |
| 368 | + end if | |
| 369 | + | |
| 352 | 370 | ! Handle ESC key - exit git mode or clear search |
| 353 | 371 | if (key == achar(27)) then |
| 354 | 372 | if (mode == 'git') then |
@@ -529,11 +547,6 @@ contains | ||
| 529 | 547 | hide_dotfiles, selected, running, force_refresh=.true.) |
| 530 | 548 | needs_full_redraw = .true. |
| 531 | 549 | end if |
| 532 | - case ('s') ! Show git status (lowercase) | |
| 533 | - if (mode == 'git') then | |
| 534 | - call show_status_view() | |
| 535 | - needs_full_redraw = .true. | |
| 536 | - end if | |
| 537 | 550 | case ('p') ! Push (lowercase) |
| 538 | 551 | if (mode == 'git') then |
| 539 | 552 | call push_prompt() |
@@ -586,11 +599,16 @@ contains | ||
| 586 | 599 | call git_diff_file(items(selected)%path, items(selected)%has_incoming) |
| 587 | 600 | needs_full_redraw = .true. |
| 588 | 601 | end if |
| 589 | - case ('c') ! View file contents (cat/bat/less) | |
| 602 | + case ('c') ! View file contents (git mode shortcut; use alt-v in normal mode) | |
| 590 | 603 | if (mode == 'git' .and. items(selected)%is_file) then |
| 591 | 604 | call view_file(items(selected)%path) |
| 592 | 605 | needs_full_redraw = .true. |
| 593 | 606 | end if |
| 607 | + case ('s') ! Show git status (git mode shortcut; use alt-s in normal mode) | |
| 608 | + if (mode == 'git') then | |
| 609 | + call show_status_view() | |
| 610 | + needs_full_redraw = .true. | |
| 611 | + end if | |
| 594 | 612 | case ('w') ! Git blame (who changed this line) |
| 595 | 613 | if (mode == 'git' .and. items(selected)%is_file) then |
| 596 | 614 | call blame_prompt(items(selected)%path) |