From 825e5c23c1cfd385cb53300380d603cde0e70425 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 11 Apr 2025 10:14:04 +0200 Subject: [PATCH] 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. --- pkg/gui/patch_exploring/state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gui/patch_exploring/state.go b/pkg/gui/patch_exploring/state.go index 4bbe881a1..73ce0a756 100644 --- a/pkg/gui/patch_exploring/state.go +++ b/pkg/gui/patch_exploring/state.go @@ -188,7 +188,7 @@ func (s *State) selectLineWithoutRangeCheck(newSelectedLineIdx int) { } func (s *State) SelectNewLineForRange(newSelectedLineIdx int) { - s.rangeStartLineIdx = newSelectedLineIdx + s.rangeStartLineIdx = s.clampLineIdx(newSelectedLineIdx) s.selectMode = RANGE