Skip to content

Commit

Permalink
Fix pressing escape after clicking in diff view (#3828)
Browse files Browse the repository at this point in the history
- **PR Description**

When clicking in a single-file diff view to enter staging (or custom
patch editing, when coming from the commit files panel), you needed to
press escape twice to exit, where the first press would seemingly do
nothing.
  • Loading branch information
stefanhaller authored Aug 17, 2024
2 parents 7676572 + 0e4d266 commit 8bcfa36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/gui/patch_exploring/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (s *State) SelectingHunk() bool {
}

func (s *State) SelectingRange() bool {
return s.selectMode == RANGE
return s.selectMode == RANGE && (s.rangeIsSticky || s.rangeStartLineIdx != s.selectedLineIdx)
}

func (s *State) SelectingLine() bool {
Expand Down

0 comments on commit 8bcfa36

Please sign in to comment.