diff --git a/pkg/gui/patch_exploring/state.go b/pkg/gui/patch_exploring/state.go index 40a28e7f7..1535e1c0f 100644 --- a/pkg/gui/patch_exploring/state.go +++ b/pkg/gui/patch_exploring/state.go @@ -94,7 +94,7 @@ func (s *State) ToggleStickySelectRange() { } func (s *State) ToggleSelectRange(sticky bool) { - if s.selectMode == RANGE { + if s.SelectingRange() { s.selectMode = LINE } else { s.selectMode = RANGE diff --git a/pkg/integration/tests/ui/range_select.go b/pkg/integration/tests/ui/range_select.go index b6fdf362e..37c63e1d0 100644 --- a/pkg/integration/tests/ui/range_select.go +++ b/pkg/integration/tests/ui/range_select.go @@ -159,19 +159,11 @@ var RangeSelect = NewIntegrationTest(NewIntegrationTestArgs{ SelectedLines( Contains("line 1"), ). - Press(keys.Universal.RangeSelectDown) - if lineIdxOfFirstItem == 6 { - v.SelectedLines( - // bug: it moved to line 2 instead of selecting both line 1 and line 2 - Contains("line 2"), - ) - } else { - // works correctly in list views though - v.SelectedLines( + Press(keys.Universal.RangeSelectDown). + SelectedLines( Contains("line 1"), Contains("line 2"), ) - } } assertRangeSelectBehaviour(t.Views().Commits().Focus(), t.Views().Branches(), 0)