1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-13 22:17:05 +02:00

allow configurable main panel split

This commit is contained in:
Jesse Duffield 2020-08-12 22:18:03 +10:00
parent 35b72420ad
commit 8430b04492
3 changed files with 13 additions and 2 deletions

View File

@ -15,6 +15,7 @@ Default path for the config file:
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
expandFocusedSidePanel: false expandFocusedSidePanel: false
mainPanelSplitMode: 'flexible' # one of 'horizontal' | 'flexible' | 'vertical'
theme: theme:
lightTheme: false # For terminals with a light background lightTheme: false # For terminals with a light background
activeBorderColor: activeBorderColor:

View File

@ -247,6 +247,7 @@ func GetDefaultConfig() []byte {
skipStashWarning: true skipStashWarning: true
sidePanelWidth: 0.3333 sidePanelWidth: 0.3333
expandFocusedSidePanel: false expandFocusedSidePanel: false
mainPanelSplitMode: 'flexible' # one of 'horizontal' | 'flexible' | 'vertical'
theme: theme:
lightTheme: false lightTheme: false
activeBorderColor: activeBorderColor:

View File

@ -132,10 +132,19 @@ func (gui *Gui) getViewDimensions(informationStr string, appStatus string) map[s
}, },
{ {
conditionalDirection: func(width int, height int) int { conditionalDirection: func(width int, height int) int {
if width < 160 && height > 30 { // 2 80 character width panels mainPanelSplitMode := gui.Config.GetUserConfig().GetString("gui.mainPanelSplitMode")
switch mainPanelSplitMode {
case "vertical":
return ROW return ROW
} else { case "horizontal":
return COLUMN return COLUMN
default:
if width < 160 && height > 30 { // 2 80 character width panels
return ROW
} else {
return COLUMN
}
} }
}, },
direction: COLUMN, direction: COLUMN,