mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Move initialization of global gocui properties to onUserConfigLoaded
This commit is contained in:
parent
65a2eccfdb
commit
04d7907864
1 changed files with 8 additions and 15 deletions
|
@ -386,6 +386,14 @@ func (gui *Gui) onUserConfigLoaded() error {
|
|||
gui.setColorScheme()
|
||||
gui.configureViewProperties()
|
||||
|
||||
gui.g.SearchEscapeKey = keybindings.GetKey(userConfig.Keybinding.Universal.Return)
|
||||
gui.g.NextSearchMatchKey = keybindings.GetKey(userConfig.Keybinding.Universal.NextMatch)
|
||||
gui.g.PrevSearchMatchKey = keybindings.GetKey(userConfig.Keybinding.Universal.PrevMatch)
|
||||
|
||||
gui.g.ShowListFooter = userConfig.Gui.ShowListFooter
|
||||
|
||||
gui.g.Mouse = userConfig.Gui.MouseEvents
|
||||
|
||||
if gui.previousLanguageConfig != userConfig.Gui.Language {
|
||||
tr, err := i18n.NewTranslationSetFromConfig(gui.Log, userConfig.Gui.Language)
|
||||
if err != nil {
|
||||
|
@ -719,20 +727,7 @@ func (gui *Gui) Run(startArgs appTypes.StartArgs) error {
|
|||
// breakpoints and stepping through code can easily take more than 30s.
|
||||
deadlock.Opts.Disable = !gui.Debug || os.Getenv(components.WAIT_FOR_DEBUGGER_ENV_VAR) != ""
|
||||
|
||||
userConfig := gui.UserConfig
|
||||
|
||||
gui.g.OnSearchEscape = func() error { gui.helpers.Search.Cancel(); return nil }
|
||||
gui.g.SearchEscapeKey = keybindings.GetKey(userConfig().Keybinding.Universal.Return)
|
||||
gui.g.NextSearchMatchKey = keybindings.GetKey(userConfig().Keybinding.Universal.NextMatch)
|
||||
gui.g.PrevSearchMatchKey = keybindings.GetKey(userConfig().Keybinding.Universal.PrevMatch)
|
||||
|
||||
gui.g.ShowListFooter = userConfig().Gui.ShowListFooter
|
||||
|
||||
if userConfig().Gui.MouseEvents {
|
||||
gui.g.Mouse = true
|
||||
}
|
||||
|
||||
gui.setColorScheme()
|
||||
|
||||
gui.g.SetManager(gocui.ManagerFunc(gui.layout))
|
||||
|
||||
|
@ -740,8 +735,6 @@ func (gui *Gui) Run(startArgs appTypes.StartArgs) error {
|
|||
return err
|
||||
}
|
||||
|
||||
gui.configureViewProperties()
|
||||
|
||||
// onNewRepo must be called after g.SetManager because SetManager deletes keybindings
|
||||
if err := gui.onNewRepo(startArgs, context.NO_CONTEXT); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue