mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-23 12:18:51 +02:00
add option to always show unstaged/staged panels
This commit is contained in:
parent
125e948d82
commit
1ef585969f
@ -54,6 +54,7 @@ gui:
|
|||||||
showCommandLog: true
|
showCommandLog: true
|
||||||
showIcons: false
|
showIcons: false
|
||||||
commandLogSize: 8
|
commandLogSize: 8
|
||||||
|
splitDiff: 'auto' # one of 'auto' | 'always'
|
||||||
git:
|
git:
|
||||||
paging:
|
paging:
|
||||||
colorArg: always
|
colorArg: always
|
||||||
|
@ -46,6 +46,7 @@ type GuiConfig struct {
|
|||||||
ShowBottomLine bool `yaml:"showBottomLine"`
|
ShowBottomLine bool `yaml:"showBottomLine"`
|
||||||
ShowIcons bool `yaml:"showIcons"`
|
ShowIcons bool `yaml:"showIcons"`
|
||||||
CommandLogSize int `yaml:"commandLogSize"`
|
CommandLogSize int `yaml:"commandLogSize"`
|
||||||
|
SplitDiff string `yaml:"splitDiff"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ThemeConfig struct {
|
type ThemeConfig struct {
|
||||||
@ -360,6 +361,7 @@ func GetDefaultConfig() *UserConfig {
|
|||||||
ShowRandomTip: true,
|
ShowRandomTip: true,
|
||||||
ShowIcons: false,
|
ShowIcons: false,
|
||||||
CommandLogSize: 8,
|
CommandLogSize: 8,
|
||||||
|
SplitDiff: "auto",
|
||||||
},
|
},
|
||||||
Git: GitConfig{
|
Git: GitConfig{
|
||||||
Paging: PagingConfig{
|
Paging: PagingConfig{
|
||||||
|
@ -67,7 +67,7 @@ func (gui *Gui) filesRenderToMain() error {
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
if node.GetHasUnstagedChanges() {
|
if node.GetHasUnstagedChanges() {
|
||||||
if node.GetHasStagedChanges() {
|
if node.GetHasStagedChanges() || gui.c.UserConfig.Gui.SplitDiff == "always" {
|
||||||
cmdObj := gui.git.WorkingTree.WorktreeFileDiffCmdObj(node, false, true, gui.IgnoreWhitespaceInDiffView)
|
cmdObj := gui.git.WorkingTree.WorktreeFileDiffCmdObj(node, false, true, gui.IgnoreWhitespaceInDiffView)
|
||||||
|
|
||||||
refreshOpts.secondary = &viewUpdateOpts{
|
refreshOpts.secondary = &viewUpdateOpts{
|
||||||
@ -77,7 +77,19 @@ func (gui *Gui) filesRenderToMain() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
refreshOpts.main.title = gui.c.Tr.StagedChanges
|
if gui.c.UserConfig.Gui.SplitDiff == "auto" {
|
||||||
|
refreshOpts.main.title = gui.c.Tr.StagedChanges
|
||||||
|
} else {
|
||||||
|
cmdObj := gui.git.WorkingTree.WorktreeFileDiffCmdObj(node, false, false, gui.IgnoreWhitespaceInDiffView)
|
||||||
|
refreshOpts.main.task = NewRunPtyTask(cmdObj.GetCmd())
|
||||||
|
|
||||||
|
cmdObj = gui.git.WorkingTree.WorktreeFileDiffCmdObj(node, false, true, gui.IgnoreWhitespaceInDiffView)
|
||||||
|
refreshOpts.secondary = &viewUpdateOpts{
|
||||||
|
title: gui.c.Tr.StagedChanges,
|
||||||
|
task: NewRunPtyTask(cmdObj.GetCmd()),
|
||||||
|
context: mainContext,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return gui.refreshMainViews(refreshOpts)
|
return gui.refreshMainViews(refreshOpts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user