mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Change direct access to Common.UserConfig to a getter
This will allow us to turn the field into an atomic.Value for safe concurrent access.
This commit is contained in:
parent
f114321322
commit
f98b57aa5e
70 changed files with 204 additions and 193 deletions
|
@ -51,7 +51,7 @@ func (self *ListController) HandleScrollRight() error {
|
|||
}
|
||||
|
||||
func (self *ListController) HandleScrollUp() error {
|
||||
scrollHeight := self.c.UserConfig.Gui.ScrollHeight
|
||||
scrollHeight := self.c.UserConfig().Gui.ScrollHeight
|
||||
self.context.GetViewTrait().ScrollUp(scrollHeight)
|
||||
if self.context.RenderOnlyVisibleLines() {
|
||||
return self.context.HandleRender()
|
||||
|
@ -61,7 +61,7 @@ func (self *ListController) HandleScrollUp() error {
|
|||
}
|
||||
|
||||
func (self *ListController) HandleScrollDown() error {
|
||||
scrollHeight := self.c.UserConfig.Gui.ScrollHeight
|
||||
scrollHeight := self.c.UserConfig().Gui.ScrollHeight
|
||||
self.context.GetViewTrait().ScrollDown(scrollHeight)
|
||||
if self.context.RenderOnlyVisibleLines() {
|
||||
return self.context.HandleRender()
|
||||
|
@ -106,10 +106,10 @@ func (self *ListController) handleLineChangeAux(f func(int), change int) error {
|
|||
cursorMoved := before != after
|
||||
if cursorMoved {
|
||||
if change == -1 {
|
||||
checkScrollUp(self.context.GetViewTrait(), self.c.UserConfig,
|
||||
checkScrollUp(self.context.GetViewTrait(), self.c.UserConfig(),
|
||||
self.context.ModelIndexToViewIndex(before), self.context.ModelIndexToViewIndex(after))
|
||||
} else if change == 1 {
|
||||
checkScrollDown(self.context.GetViewTrait(), self.c.UserConfig,
|
||||
checkScrollDown(self.context.GetViewTrait(), self.c.UserConfig(),
|
||||
self.context.ModelIndexToViewIndex(before), self.context.ModelIndexToViewIndex(after))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue