File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ ### Fixed
11+
12+ - Scroll to root commit no longer crashes if root is a fork.
1013
1114
1215## [ 0.1.18] - 2023-01-15
Original file line number Diff line number Diff line change @@ -166,10 +166,9 @@ impl StatefulWidget for GraphView<'_> {
166166 let move_to_end = if selected_index >= state. indices . len ( ) - 1 {
167167 state. graph_lines . len ( ) - 1
168168 } else {
169- ( state. indices [ selected_index + 1 ] - 1 ) . clamp (
170- move_to_selected + SCROLL_MARGIN ,
171- state. graph_lines . len ( ) - 1 ,
172- )
169+ ( state. indices [ selected_index + 1 ] - 1 )
170+ . max ( move_to_selected + SCROLL_MARGIN )
171+ . min ( state. graph_lines . len ( ) - 1 )
173172 } ;
174173 let move_to_start = move_to_selected. saturating_sub ( SCROLL_MARGIN ) ;
175174
You can’t perform that action at this time.
0 commit comments