1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-27 22:38:09 +02:00

Move DiffContextSize and RenameSimilarityThreshold to user config

This commit is contained in:
Stefan Haller
2025-07-07 15:16:51 +02:00
parent 8d7bfd131e
commit f318e45e9d
17 changed files with 73 additions and 64 deletions

View File

@@ -71,8 +71,8 @@ func (self *ContextLinesController) Increase() error {
return err
}
if self.c.AppState.DiffContextSize < math.MaxUint64 {
self.c.AppState.DiffContextSize++
if self.c.UserConfig().Git.DiffContextSize < math.MaxUint64 {
self.c.UserConfig().Git.DiffContextSize++
}
return self.applyChange()
}
@@ -86,8 +86,8 @@ func (self *ContextLinesController) Decrease() error {
return err
}
if self.c.AppState.DiffContextSize > 0 {
self.c.AppState.DiffContextSize--
if self.c.UserConfig().Git.DiffContextSize > 0 {
self.c.UserConfig().Git.DiffContextSize--
}
return self.applyChange()
}
@@ -96,8 +96,7 @@ func (self *ContextLinesController) Decrease() error {
}
func (self *ContextLinesController) applyChange() error {
self.c.Toast(fmt.Sprintf(self.c.Tr.DiffContextSizeChanged, self.c.AppState.DiffContextSize))
self.c.SaveAppStateAndLogError()
self.c.Toast(fmt.Sprintf(self.c.Tr.DiffContextSizeChanged, self.c.UserConfig().Git.DiffContextSize))
currentContext := self.currentSidePanel()
switch currentContext.GetKey() {