1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Return error from RefreshOptions.Then

This commit is contained in:
Stefan Haller
2024-04-14 20:21:37 +02:00
parent bbad3a70ce
commit 653994845e
6 changed files with 20 additions and 14 deletions

View File

@ -171,7 +171,7 @@ func (self *ModeHelper) ClearFiltering() error {
return self.c.Refresh(types.RefreshOptions{
Scope: []types.RefreshableView{types.COMMITS},
Then: func() {
Then: func() error {
// Find the commit that was last selected in filtering mode, and select it again after refreshing
if !self.c.Contexts().LocalCommits.SelectCommitByHash(selectedCommitHash) {
// If we couldn't find it (either because no commit was selected
@ -180,6 +180,7 @@ func (self *ModeHelper) ClearFiltering() error {
// before we entered filtering
self.c.Contexts().LocalCommits.SelectCommitByHash(self.c.Modes().Filtering.GetSelectedCommitHash())
}
return nil
},
})
}