diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-16 14:46:53 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | 1dd7307fde033dae5fececac15810a99e26c3d91 (patch) | |
tree | 4e851c9e3229a6fe3b4191f6311d05d7a9142960 /pkg/gui/diff_context_size.go | |
parent | a90b6efded49abcfa2516db794d7875b0396f558 (diff) |
start moving commit panel handlers into controller
more
and more
move rebase commit refreshing into existing abstraction
and more
and more
WIP
and more
handling clicks
properly fix merge conflicts
update cheatsheet
lots more preparation to start moving things into controllers
WIP
better typing
expand on remotes controller
moving more code into controllers
Diffstat (limited to 'pkg/gui/diff_context_size.go')
-rw-r--r-- | pkg/gui/diff_context_size.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/pkg/gui/diff_context_size.go b/pkg/gui/diff_context_size.go index e5ea340a6..5caefd032 100644 --- a/pkg/gui/diff_context_size.go +++ b/pkg/gui/diff_context_size.go @@ -2,9 +2,11 @@ package gui import ( "errors" + + "github.com/jesseduffield/lazygit/pkg/gui/types" ) -var CONTEXT_KEYS_SHOWING_DIFFS = []ContextKey{ +var CONTEXT_KEYS_SHOWING_DIFFS = []types.ContextKey{ FILES_CONTEXT_KEY, COMMIT_FILES_CONTEXT_KEY, STASH_CONTEXT_KEY, @@ -28,10 +30,10 @@ func isShowingDiff(gui *Gui) bool { func (gui *Gui) IncreaseContextInDiffView() error { if isShowingDiff(gui) { if err := gui.CheckCanChangeContext(); err != nil { - return gui.PopupHandler.Error(err) + return gui.c.Error(err) } - gui.UserConfig.Git.DiffContextSize = gui.UserConfig.Git.DiffContextSize + 1 + gui.c.UserConfig.Git.DiffContextSize = gui.c.UserConfig.Git.DiffContextSize + 1 return gui.handleDiffContextSizeChange() } @@ -39,14 +41,14 @@ func (gui *Gui) IncreaseContextInDiffView() error { } func (gui *Gui) DecreaseContextInDiffView() error { - old_size := gui.UserConfig.Git.DiffContextSize + old_size := gui.c.UserConfig.Git.DiffContextSize if isShowingDiff(gui) && old_size > 1 { if err := gui.CheckCanChangeContext(); err != nil { - return gui.PopupHandler.Error(err) + return gui.c.Error(err) } - gui.UserConfig.Git.DiffContextSize = old_size - 1 + gui.c.UserConfig.Git.DiffContextSize = old_size - 1 return gui.handleDiffContextSizeChange() } @@ -67,8 +69,8 @@ func (gui *Gui) handleDiffContextSizeChange() error { } func (gui *Gui) CheckCanChangeContext() error { - if gui.Git.Patch.PatchManager.Active() { - return errors.New(gui.Tr.CantChangeContextSizeError) + if gui.git.Patch.PatchManager.Active() { + return errors.New(gui.c.Tr.CantChangeContextSizeError) } return nil |