Re-render the main view without re-focusing the panel beneath it

Toggling whitespace needs the panel beneath to render its diff again, which
is what HandleRenderToMain is for; HandleFocus does that and also everything
else that belongs to a panel gaining the focus, which this panel already has
or, when the focus is in the main view, does not want. Re-selecting its
current item is harmless, but re-deriving its highlight as a focused panel's
is not: the selection turns bright while the user is somewhere else.

Changing the context size and switching diff renderers already ask for a
re-render this way.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Stefan Haller 2026-08-21 13:21:10 +02:00
parent e8009599e0
commit d1707d5dd2
2 changed files with 1 additions and 4 deletions

View file

@ -27,6 +27,6 @@ func (self *ToggleWhitespaceAction) Call() error {
self.c.UserConfig().Git.IgnoreWhitespaceInDiffView = !self.c.UserConfig().Git.IgnoreWhitespaceInDiffView
self.c.Context().CurrentSide().HandleFocus(types.OnFocusOpts{})
self.c.Context().CurrentSide().HandleRenderToMain()
return nil
}

View file

@ -26,9 +26,6 @@ var ToggleWhitespaceKeepsUnfocusedSelectionDimmed = NewIntegrationTest(NewIntegr
Press(keys.Universal.ToggleWhitespaceInDiffView)
t.Views().Files().
/* EXPECTED:
SelectionIsInactive()
ACTUAL: */
SelectionIsActive()
},
})