From f5b8619ded50b9f3507104a8a914eabbadd25316 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 3 Sep 2024 19:09:50 +0200 Subject: [PATCH] Switch to Files panel after popping a stash --- pkg/gui/controllers/stash_controller.go | 2 ++ pkg/integration/tests/stash/apply.go | 1 + pkg/integration/tests/stash/pop.go | 1 + 3 files changed, 4 insertions(+) diff --git a/pkg/gui/controllers/stash_controller.go b/pkg/gui/controllers/stash_controller.go index 4d1cd723392..808376c53b4 100644 --- a/pkg/gui/controllers/stash_controller.go +++ b/pkg/gui/controllers/stash_controller.go @@ -111,6 +111,7 @@ func (self *StashController) handleStashApply(stashEntry *models.StashEntry) err if err != nil { return err } + self.c.Context().Push(self.c.Contexts().Files) return nil } @@ -137,6 +138,7 @@ func (self *StashController) handleStashPop(stashEntry *models.StashEntry) error if err != nil { return err } + self.c.Context().Push(self.c.Contexts().Files) return nil } diff --git a/pkg/integration/tests/stash/apply.go b/pkg/integration/tests/stash/apply.go index 379f2fa2f9e..768ab084db5 100644 --- a/pkg/integration/tests/stash/apply.go +++ b/pkg/integration/tests/stash/apply.go @@ -36,6 +36,7 @@ var Apply = NewIntegrationTest(NewIntegrationTestArgs{ ) t.Views().Files(). + IsFocused(). Lines( Contains("file"), ) diff --git a/pkg/integration/tests/stash/pop.go b/pkg/integration/tests/stash/pop.go index 9eec96c5510..c7e6400722d 100644 --- a/pkg/integration/tests/stash/pop.go +++ b/pkg/integration/tests/stash/pop.go @@ -34,6 +34,7 @@ var Pop = NewIntegrationTest(NewIntegrationTestArgs{ IsEmpty() t.Views().Files(). + IsFocused(). Lines( Contains("file"), )