1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-21 12:16:54 +02:00

Fix range select bug

After discarding file changes from the commit, the was still referencing
these indexes as being part of the range select. The consequence was
needing to hit escape twice to exit commit files in some situations.
Canceling the range select after discarding changes fixes that.
This commit is contained in:
Aaron Hoffman 2024-01-30 21:56:12 -06:00
parent d138f7ce86
commit c431698dba
2 changed files with 4 additions and 4 deletions

View File

@ -217,7 +217,10 @@ func (self *CommitFilesController) discard(selectedNodes []*filetree.CommitFileN
return err
}
return self.c.Refresh(types.RefreshOptions{Mode: types.BLOCK_UI})
if self.context().RangeSelectEnabled() {
self.context().GetList().CancelRangeSelect()
}
return self.c.Refresh(types.RefreshOptions{Mode: types.SYNC})
})
},
})

View File

@ -105,9 +105,6 @@ var DiscardOldFileChanges = NewIntegrationTest(NewIntegrationTestArgs{
Lines(
Contains("(none)"),
).
// for some reason I need to press escape twice. Seems like it happens every time
// more than one file is removed from a commit
PressEscape().
PressEscape()
// Check removing multiple files from 2 directories w/ a custom patch.