mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-06 03:53:59 +02:00
Merge pull request #2358 from phanithinks/#2319_default_screen_mode
This commit is contained in:
commit
c0e805718d
@ -21,6 +21,7 @@ If you want to change the config directory:
|
|||||||
```yaml
|
```yaml
|
||||||
gui:
|
gui:
|
||||||
# stuff relating to the UI
|
# stuff relating to the UI
|
||||||
|
windowSize: 'normal' # one of 'normal' | 'half' | 'full' default is 'normal'
|
||||||
scrollHeight: 2 # how many lines you scroll by
|
scrollHeight: 2 # how many lines you scroll by
|
||||||
scrollPastBottom: true # enable scrolling past the bottom
|
scrollPastBottom: true # enable scrolling past the bottom
|
||||||
sidePanelWidth: 0.3333 # number from 0 to 1
|
sidePanelWidth: 0.3333 # number from 0 to 1
|
||||||
|
@ -51,6 +51,7 @@ type GuiConfig struct {
|
|||||||
CommandLogSize int `yaml:"commandLogSize"`
|
CommandLogSize int `yaml:"commandLogSize"`
|
||||||
SplitDiff string `yaml:"splitDiff"`
|
SplitDiff string `yaml:"splitDiff"`
|
||||||
SkipRewordInEditorWarning bool `yaml:"skipRewordInEditorWarning"`
|
SkipRewordInEditorWarning bool `yaml:"skipRewordInEditorWarning"`
|
||||||
|
WindowSize string `yaml:"windowSize"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ThemeConfig struct {
|
type ThemeConfig struct {
|
||||||
|
@ -277,7 +277,7 @@ func (gui *Gui) resetState(startArgs appTypes.StartArgs, reuseState bool) {
|
|||||||
contextTree := gui.contextTree()
|
contextTree := gui.contextTree()
|
||||||
|
|
||||||
initialContext := initialContext(contextTree, startArgs)
|
initialContext := initialContext(contextTree, startArgs)
|
||||||
initialScreenMode := initialScreenMode(startArgs)
|
initialScreenMode := initialScreenMode(startArgs, gui.Config)
|
||||||
|
|
||||||
initialWindowViewNameMap := gui.initialWindowViewNameMap(contextTree)
|
initialWindowViewNameMap := gui.initialWindowViewNameMap(contextTree)
|
||||||
|
|
||||||
@ -307,11 +307,20 @@ func (gui *Gui) resetState(startArgs appTypes.StartArgs, reuseState bool) {
|
|||||||
gui.RepoStateMap[Repo(currentDir)] = gui.State
|
gui.RepoStateMap[Repo(currentDir)] = gui.State
|
||||||
}
|
}
|
||||||
|
|
||||||
func initialScreenMode(startArgs appTypes.StartArgs) WindowMaximisation {
|
func initialScreenMode(startArgs appTypes.StartArgs, config config.AppConfigurer) WindowMaximisation {
|
||||||
if startArgs.FilterPath != "" || startArgs.GitArg != appTypes.GitArgNone {
|
if startArgs.FilterPath != "" || startArgs.GitArg != appTypes.GitArgNone {
|
||||||
return SCREEN_HALF
|
return SCREEN_HALF
|
||||||
} else {
|
} else {
|
||||||
return SCREEN_NORMAL
|
defaultWindowSize := config.GetUserConfig().Gui.WindowSize
|
||||||
|
|
||||||
|
switch defaultWindowSize {
|
||||||
|
case "half":
|
||||||
|
return SCREEN_HALF
|
||||||
|
case "full":
|
||||||
|
return SCREEN_FULL
|
||||||
|
default:
|
||||||
|
return SCREEN_NORMAL
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user