mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-23 22:24:51 +02:00
Add screen-mode command line argument
Introduce a new "screen-mode" command line argument that allows a user to specify which screen mode (normal, half or full) Lazygit should use when it runs. This argument will take precedence over a default Window Size specified in user config.
This commit is contained in:
committed by
Jesse Duffield
parent
fc69945a80
commit
54680e0836
@@ -580,19 +580,23 @@ func initialWindowViewNameMap(contextTree *context.ContextTree) *utils.ThreadSaf
|
||||
}
|
||||
|
||||
func initialScreenMode(startArgs appTypes.StartArgs, config config.AppConfigurer) types.WindowMaximisation {
|
||||
if startArgs.FilterPath != "" || startArgs.GitArg != appTypes.GitArgNone {
|
||||
if startArgs.ScreenMode != "" {
|
||||
return getWindowMaximisation(startArgs.ScreenMode)
|
||||
} else if startArgs.FilterPath != "" || startArgs.GitArg != appTypes.GitArgNone {
|
||||
return types.SCREEN_FULL
|
||||
} else {
|
||||
defaultWindowSize := config.GetUserConfig().Gui.WindowSize
|
||||
return getWindowMaximisation(config.GetUserConfig().Gui.WindowSize)
|
||||
}
|
||||
}
|
||||
|
||||
switch defaultWindowSize {
|
||||
case "half":
|
||||
return types.SCREEN_HALF
|
||||
case "full":
|
||||
return types.SCREEN_FULL
|
||||
default:
|
||||
return types.SCREEN_NORMAL
|
||||
}
|
||||
func getWindowMaximisation(modeString string) types.WindowMaximisation {
|
||||
switch modeString {
|
||||
case "half":
|
||||
return types.SCREEN_HALF
|
||||
case "full":
|
||||
return types.SCREEN_FULL
|
||||
default:
|
||||
return types.SCREEN_NORMAL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user