Skip to content

Conversation

@jesseduffield
Copy link
Owner

This fixes a bug where if you're focused on the commit message panel, then say an error panel pops up, the commit message panel goes to the back of the views but then focus is returned to it

Now we just bring that panel to the front when it's focused.

But while fixing this bug I also decided to introduce the idea of not ever returning focus to 'second class panels' which currently just contains the confirmation panel.

Can be tested with this:

diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index e3cc615..2e98f16 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -290,6 +290,11 @@ func (gui *Gui) layout(g *gocui.Gui) error {
                        return err
                }

+               go func() {
+                       time.Sleep(5 * time.Second)
+                       gui.createErrorPanel(g, "test")
+               }()
+
                // these are only called once (it's a place to put all the things you want
                // to happen on startup after the screen is first rendered)
                gui.Updater.CheckForNewUpdate(gui.onBackgroundUpdateCheckFinish, false)

@codecov-io
Copy link

codecov-io commented Sep 19, 2018

Codecov Report

Merging #295 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #295      +/-   ##
==========================================
+ Coverage   93.61%   93.63%   +0.01%     
==========================================
  Files          12       12              
  Lines        1628     1633       +5     
==========================================
+ Hits         1524     1529       +5     
  Misses        101      101              
  Partials        3        3
Impacted Files Coverage Δ
pkg/utils/utils.go 76.47% <100%> (+1.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3101c50...2229a6e. Read the comment docs.

@jesseduffield jesseduffield merged commit 3df4a94 into master Sep 22, 2018
@jesseduffield jesseduffield deleted the hotfix/commit-message-panel-focus branch July 7, 2019 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants