From bbaeab68e1f106b5412d85dc2bd8d4aec8a6b258 Mon Sep 17 00:00:00 2001 From: stk Date: Tue, 7 Feb 2023 09:17:43 +0100 Subject: Better redrawing after toggling "ignore whitespace" There's no need for refreshing anything; all that's needed is to re-focus the selected list item. This way it will also work in other panels, which we are about to add in the next commit. --- pkg/gui/whitespace-toggle.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/gui/whitespace-toggle.go b/pkg/gui/whitespace-toggle.go index ad82bc036..b4ee798cc 100644 --- a/pkg/gui/whitespace-toggle.go +++ b/pkg/gui/whitespace-toggle.go @@ -1,5 +1,9 @@ package gui +import ( + "github.com/jesseduffield/lazygit/pkg/gui/types" +) + func (gui *Gui) toggleWhitespaceInDiffView() error { gui.IgnoreWhitespaceInDiffView = !gui.IgnoreWhitespaceInDiffView @@ -9,5 +13,5 @@ func (gui *Gui) toggleWhitespaceInDiffView() error { } gui.c.Toast(toastMessage) - return gui.refreshFilesAndSubmodules() + return gui.currentSideListContext().HandleFocus(types.OnFocusOpts{}) } -- cgit v1.2.3