Skip to content

Commit

Permalink
Merge pull request #2 from wez/master
Browse files Browse the repository at this point in the history
allow `b` for paging backwards
  • Loading branch information
markbt committed Jun 3, 2019
2 parents 0403834 + 8b56a69 commit 8107d12
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ is equivalent to the previous example.

* **Cursor Keys**: Move one line or four columns.
* **`Shift` + Cursor Keys**: Move one quarter of the screen.
* **`Page Up`** and **`Page Down`**: Move a full screen up or down.
* **`Backspace`** and **`Space`**: Move a full screen up or down.
* **`Page Down`** or **`Space`**: Move a full page down.
* **`Page Up`**, **`Backspace`** or **`b`**: Move a full page up.
* **`Home`** and **`End`**: Move to the top or bottom of the file.
* **`:`**: Go to a line number or percentage through the file.
* **`[`** and **`]`**: Switch to the previous or next file.
Expand Down
32 changes: 16 additions & 16 deletions src/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@

General

q Quit
? or h Show this help
Esc Close help or any open prompt
q Quit
? or h Show this help
Esc Close help or any open prompt

Navigation

Cursor Keys Move one line or four columns
Shift + Cursor Keys Move one quarter of the screen
Page Up and Page Down Move a full screen up or down
Backspace and Space Move a full screen up or down
Home and End Move to the top or bottom of the file
: Move to a line number or percentage
[ and ] Switch to the previous or next file
Cursor Keys Move one line or four columns
Shift + Cursor Keys Move one quarter of the screen
Page Down or Space Move a full page down
Page Up, Backspace or b Move a full page up
Home and End Move to the top or bottom of the file
: Move to a line number or percentage
[ and ] Switch to the previous or next file

Presentation

# Toggle display of line numbers
# Toggle display of line numbers

Searching

/ Search from the top of the file
< and > Search backwards or forwards from here
/ Search from the top of the file
< and > Search backwards or forwards from here

. and , Move to the next or previous match
n and p Move to the next or previous matching line
( and ) Move to the first or last match
. and , Move to the next or previous match
n and p Move to the next or previous matching line
( and ) Move to the first or last match


4 changes: 3 additions & 1 deletion src/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,9 @@ impl Screen {
1,
));
}
(Modifiers::NONE, PageUp) | (Modifiers::NONE, Backspace) => {
(Modifiers::NONE, PageUp)
| (Modifiers::NONE, Backspace)
| (Modifiers::NONE, Char('b')) => {
self.scroll_up(max(
self.rendered_position.height - self.rendered_overlay_height,
1,
Expand Down

0 comments on commit 8107d12

Please sign in to comment.