1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-04 03:48:07 +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
sidePanelWidth: 0.3333 # number from 0 to 1
expandFocusedSidePanel: false
mainPanelSplitMode: 'flexible' # one of 'horizontal' | 'flexible' | 'vertical'
theme:
lightTheme: false # For terminals with a light background
activeBorderColor:

View File

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

View File

@ -132,10 +132,19 @@ func (gui *Gui) getViewDimensions(informationStr string, appStatus string) map[s
},
{
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
} else {
case "horizontal":
return COLUMN
default:
if width < 160 && height > 30 { // 2 80 character width panels
return ROW
} else {
return COLUMN
}
}
},
direction: COLUMN,