mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Select same commit again after pressing "e" to edit a commit
When editing a commit, the index of the current commit can change; for example, when merge commits are involved, or when working with stacked branches where "update-ref" commands may be added above the selected commit. Reselect the current commit after pressing "e"; this requires doing the refresh blocking on the main thread. (Another option that I considered was to use a SYNC refresh, and then select the new line with an OnUIThread inside the Then function. This also works, but results in a very visible lag.)
This commit is contained in:
@ -125,8 +125,8 @@ func isMergeConflictErr(errStr string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (self *MergeAndRebaseHelper) CheckMergeOrRebase(result error) error {
|
||||
if err := self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC}); err != nil {
|
||||
func (self *MergeAndRebaseHelper) CheckMergeOrRebaseWithRefreshOptions(result error, refreshOptions types.RefreshOptions) error {
|
||||
if err := self.c.Refresh(refreshOptions); err != nil {
|
||||
return err
|
||||
}
|
||||
if result == nil {
|
||||
@ -143,6 +143,10 @@ func (self *MergeAndRebaseHelper) CheckMergeOrRebase(result error) error {
|
||||
}
|
||||
}
|
||||
|
||||
func (self *MergeAndRebaseHelper) CheckMergeOrRebase(result error) error {
|
||||
return self.CheckMergeOrRebaseWithRefreshOptions(result, types.RefreshOptions{Mode: types.ASYNC})
|
||||
}
|
||||
|
||||
func (self *MergeAndRebaseHelper) CheckForConflicts(result error) error {
|
||||
if result == nil {
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user