File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -112,19 +112,22 @@ impl Revlog {
112
112
. unwrap ( )
113
113
. max ( 1 ) ;
114
114
115
+ let page_offset =
116
+ usize:: from ( self . current_height ) . saturating_sub ( 1 ) ;
117
+
115
118
self . selection = match scroll {
116
119
ScrollType :: Up => {
117
120
self . selection . saturating_sub ( speed_int)
118
121
}
119
122
ScrollType :: Down => {
120
123
self . selection . saturating_add ( speed_int)
121
124
}
122
- ScrollType :: PageUp => self . selection . saturating_sub (
123
- usize :: from ( self . current_height ) . saturating_sub ( 1 ) ,
124
- ) ,
125
- ScrollType :: PageDown => self . selection . saturating_add (
126
- usize :: from ( self . current_height ) . saturating_sub ( 1 ) ,
127
- ) ,
125
+ ScrollType :: PageUp => {
126
+ self . selection . saturating_sub ( page_offset )
127
+ }
128
+ ScrollType :: PageDown => {
129
+ self . selection . saturating_add ( page_offset )
130
+ }
128
131
ScrollType :: Home => 0 ,
129
132
ScrollType :: End => self . selection_max ,
130
133
} ;
You can’t perform that action at this time.
0 commit comments