1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-04 10:34:55 +02:00

Added screenMode configuration to gui configuration

This commit is contained in:
Phanindra kumar Paladi 2023-01-11 16:51:46 +05:30
parent c769a78db5
commit f4ccb68464
3 changed files with 14 additions and 3 deletions

View File

@ -21,6 +21,7 @@ If you want to change the config directory:
```yaml
gui:
# stuff relating to the UI
screenMode: 'normal' # one of 'normal' | 'half' | 'full' default is 'normal'
scrollHeight: 2 # how many lines you scroll by
scrollPastBottom: true # enable scrolling past the bottom
sidePanelWidth: 0.3333 # number from 0 to 1

View File

@ -50,6 +50,7 @@ type GuiConfig struct {
ShowIcons bool `yaml:"showIcons"`
CommandLogSize int `yaml:"commandLogSize"`
SplitDiff string `yaml:"splitDiff"`
ScreenMode string `yaml:"screenMode"`
}
type ThemeConfig struct {

View File

@ -277,7 +277,7 @@ func (gui *Gui) resetState(startArgs appTypes.StartArgs, reuseState bool) {
contextTree := gui.contextTree()
initialContext := initialContext(contextTree, startArgs)
initialScreenMode := initialScreenMode(startArgs)
initialScreenMode := initialScreenMode(startArgs, gui.Config)
initialWindowViewNameMap := gui.initialWindowViewNameMap(contextTree)
@ -307,12 +307,21 @@ func (gui *Gui) resetState(startArgs appTypes.StartArgs, reuseState bool) {
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 {
return SCREEN_HALF
} else {
defaultScreenMode := config.GetUserConfig().Gui.ScreenMode
switch defaultScreenMode {
case "half":
return SCREEN_HALF
case "full":
return SCREEN_FULL
default:
return SCREEN_NORMAL
}
}
}
func initialContext(contextTree *context.ContextTree, startArgs appTypes.StartArgs) types.IListContext {