Skip to content

Commit 825e5c2

Browse files
committed
Fix crash when dragging from below the end of the diff upwards and then staging the range
We need to clamp the range start index of a selection range in the same way as we clamp the selection index.
1 parent a3ae1c8 commit 825e5c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: pkg/gui/patch_exploring/state.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func (s *State) selectLineWithoutRangeCheck(newSelectedLineIdx int) {
188188
}
189189

190190
func (s *State) SelectNewLineForRange(newSelectedLineIdx int) {
191-
s.rangeStartLineIdx = newSelectedLineIdx
191+
s.rangeStartLineIdx = s.clampLineIdx(newSelectedLineIdx)
192192

193193
s.selectMode = RANGE
194194

0 commit comments

Comments
 (0)