diff --git a/pkg/gui/controllers/commits_files_controller.go b/pkg/gui/controllers/commits_files_controller.go index 2a5b8139a..59e0a7f4e 100644 --- a/pkg/gui/controllers/commits_files_controller.go +++ b/pkg/gui/controllers/commits_files_controller.go @@ -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}) }) }, }) diff --git a/pkg/integration/tests/commit/discard_old_file_changes.go b/pkg/integration/tests/commit/discard_old_file_changes.go index 4b97a30b7..1ab189264 100644 --- a/pkg/integration/tests/commit/discard_old_file_changes.go +++ b/pkg/integration/tests/commit/discard_old_file_changes.go @@ -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.