diff options
author | DerTeta <derteta@gmx.de> | 2021-09-11 19:29:33 +0200 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-12-06 22:37:28 +1100 |
commit | ba844c18a5cad4a268ef0ebf03b2b85f6bfe0b92 (patch) | |
tree | 306ba1f4d16b38e42818e51d29afc66ac1b3bd1d /pkg/gui/diff_context_size.go | |
parent | e1cf6912db329b47f60071f58bb970a583cf3003 (diff) |
Add the `DecreaseContextInDiffView` function
Diffstat (limited to 'pkg/gui/diff_context_size.go')
-rw-r--r-- | pkg/gui/diff_context_size.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/gui/diff_context_size.go b/pkg/gui/diff_context_size.go index 3e6e6b4a2..a54a9c418 100644 --- a/pkg/gui/diff_context_size.go +++ b/pkg/gui/diff_context_size.go @@ -14,3 +14,14 @@ func (gui *Gui) IncreaseContextInDiffView() error { return nil } + +func (gui *Gui) DecreaseContextInDiffView() error { + old_size := gui.Config.GetUserConfig().Git.DiffContextSize + + if isShowingDiff(gui) && old_size > 1 { + gui.Config.GetUserConfig().Git.DiffContextSize = old_size - 1 + return gui.postRefreshUpdate(gui.currentStaticContext()) + } + + return nil +} |