summaryrefslogtreecommitdiffstats
path: root/pkg/gui/files_panel.go
diff options
context:
space:
mode:
authorHiromasaNojima <67505578+HiromasaNojima@users.noreply.github.com>2022-05-08 17:24:55 +0900
committerHiromasaNojima <67505578+HiromasaNojima@users.noreply.github.com>2022-05-08 17:24:55 +0900
commit1ef585969fbbbf752af0db3a8ff688cda50a2f9f (patch)
tree63ec56a38de3c9625628fee71307750efa8689a7 /pkg/gui/files_panel.go
parent125e948d82c33226f92a1ebe18361633116370d3 (diff)
add option to always show unstaged/staged panels
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r--pkg/gui/files_panel.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index 765e33e4c..13d8e0470 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -67,7 +67,7 @@ func (gui *Gui) filesRenderToMain() error {
}}
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)
refreshOpts.secondary = &viewUpdateOpts{
@@ -77,7 +77,19 @@ func (gui *Gui) filesRenderToMain() error {
}
}
} 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)