1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-13 01:30:53 +02:00

Add the IncreaseContextInDiffView function

This commit is contained in:
DerTeta
2021-09-03 22:40:11 +02:00
committed by Jesse Duffield
parent c99d373e13
commit e1cf6912db
2 changed files with 98 additions and 0 deletions

View File

@ -0,0 +1,16 @@
package gui
func isShowingDiff(gui *Gui) bool {
key := gui.currentStaticContext().GetKey()
return key == FILES_CONTEXT_KEY || key == COMMIT_FILES_CONTEXT_KEY || key == STASH_CONTEXT_KEY || key == BRANCH_COMMITS_CONTEXT_KEY || key == SUB_COMMITS_CONTEXT_KEY || key == MAIN_STAGING_CONTEXT_KEY || key == MAIN_PATCH_BUILDING_CONTEXT_KEY
}
func (gui *Gui) IncreaseContextInDiffView() error {
if isShowingDiff(gui) {
gui.Config.GetUserConfig().Git.DiffContextSize = gui.Config.GetUserConfig().Git.DiffContextSize + 1
return gui.postRefreshUpdate(gui.currentStaticContext())
}
return nil
}