Skip to content

Commit 4d51234

Browse files
committed
Enable hunk staging mode by default
1 parent eb41bd2 commit 4d51234

File tree

14 files changed

+23
-13
lines changed

14 files changed

+23
-13
lines changed

docs/Config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ gui:
117117
wrapLinesInStagingView: true
118118

119119
# If true, hunk selection mode will be enabled by default when entering the staging view.
120-
useHunkModeInStagingView: false
120+
useHunkModeInStagingView: true
121121

122122
# One of 'auto' (default) | 'en' | 'zh-CN' | 'zh-TW' | 'pl' | 'nl' | 'ja' | 'ko' | 'ru'
123123
language: auto

pkg/config/user_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ func GetDefaultConfig() *UserConfig {
739739
MainPanelSplitMode: "flexible",
740740
EnlargedSideViewLocation: "left",
741741
WrapLinesInStagingView: true,
742-
UseHunkModeInStagingView: false,
742+
UseHunkModeInStagingView: true,
743743
Language: "auto",
744744
TimeFormat: "02 Jan 06",
745745
ShortTimeFormat: time.Kitchen,

pkg/integration/tests/commit/stage_range_of_lines.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ var StageRangeOfLines = NewIntegrationTest(NewIntegrationTestArgs{
99
Description: "Staging a range of lines",
1010
ExtraCmdArgs: []string{},
1111
Skip: false,
12-
SetupConfig: func(config *config.AppConfig) {},
12+
SetupConfig: func(config *config.AppConfig) {
13+
config.GetUserConfig().Gui.UseHunkModeInStagingView = false
14+
},
1315
SetupRepo: func(shell *Shell) {
1416
shell.CreateFileAndAdd("myfile", "1st\n2nd\n3rd\n4th\n5th\n6th\n")
1517
shell.Commit("Add file")

pkg/integration/tests/demo/custom_patch.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var CustomPatch = NewIntegrationTest(NewIntegrationTestArgs{
2222
IsDemo: true,
2323
SetupConfig: func(cfg *config.AppConfig) {
2424
setDefaultDemoConfig(cfg)
25+
cfg.GetUserConfig().Gui.UseHunkModeInStagingView = false
2526
},
2627
SetupRepo: func(shell *Shell) {
2728
shell.CreateNCommitsWithRandomMessages(30)

pkg/integration/tests/patch_building/move_to_index_partial.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ var MoveToIndexPartial = NewIntegrationTest(NewIntegrationTestArgs{
4848
Contains(`+third line2`),
4949
).
5050
PressPrimaryAction().
51-
PressPrimaryAction().
5251
Tap(func() {
5352
t.Views().Information().Content(Contains("Building patch"))
5453

pkg/integration/tests/patch_building/specific_selection.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ var SpecificSelection = NewIntegrationTest(NewIntegrationTestArgs{
99
Description: "Build a custom patch with a specific selection of lines, adding individual lines, as well as a range and hunk, and adding a file directly",
1010
ExtraCmdArgs: []string{},
1111
Skip: false,
12-
SetupConfig: func(config *config.AppConfig) {},
12+
SetupConfig: func(config *config.AppConfig) {
13+
config.GetUserConfig().Gui.UseHunkModeInStagingView = false
14+
},
1315
SetupRepo: func(shell *Shell) {
1416
shell.CreateFileAndAdd("hunk-file", "1a\n1b\n1c\n1d\n1e\n1f\n1g\n1h\n1i\n1j\n1k\n1l\n1m\n1n\n1o\n1p\n1q\n1r\n1s\n1t\n1u\n1v\n1w\n1x\n1y\n1z\n")
1517
shell.Commit("first commit")

pkg/integration/tests/staging/diff_context_change.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ var DiffContextChange = NewIntegrationTest(NewIntegrationTestArgs{
5050

5151
t.Views().Staging().
5252
IsFocused().
53-
Press(keys.Main.ToggleSelectHunk).
5453
SelectedLines(
5554
Contains(`-3a`),
5655
Contains(`+3b`),
@@ -92,7 +91,6 @@ var DiffContextChange = NewIntegrationTest(NewIntegrationTestArgs{
9291

9392
t.Views().StagingSecondary().
9493
IsFocused().
95-
Press(keys.Main.ToggleSelectHunk).
9694
SelectedLines(
9795
Contains(`-3a`),
9896
Contains(`+3b`),

pkg/integration/tests/staging/discard_all_changes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var DiscardAllChanges = NewIntegrationTest(NewIntegrationTestArgs{
3131

3232
t.Views().Staging().
3333
IsFocused().
34+
Press(keys.Main.ToggleSelectHunk).
3435
SelectedLines(Contains("+three")).
3536
// discard the line
3637
Press(keys.Universal.Remove).

pkg/integration/tests/staging/stage_hunks.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ var StageHunks = NewIntegrationTest(NewIntegrationTestArgs{
99
Description: "Stage and unstage various hunks of a file in the staging panel",
1010
ExtraCmdArgs: []string{},
1111
Skip: false,
12-
SetupConfig: func(config *config.AppConfig) {},
12+
SetupConfig: func(config *config.AppConfig) {
13+
config.GetUserConfig().Gui.UseHunkModeInStagingView = false
14+
},
1315
SetupRepo: func(shell *Shell) {
1416
shell.CreateFileAndAdd("file1", "1a\n2a\n3a\n4a\n5a\n6a\n7a\n8a")
1517
shell.Commit("one")

pkg/integration/tests/staging/stage_lines.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ var StageLines = NewIntegrationTest(NewIntegrationTestArgs{
99
Description: "Stage and unstage various lines of a file in the staging panel",
1010
ExtraCmdArgs: []string{},
1111
Skip: false,
12-
SetupConfig: func(config *config.AppConfig) {},
12+
SetupConfig: func(config *config.AppConfig) {
13+
config.GetUserConfig().Gui.UseHunkModeInStagingView = false
14+
},
1315
SetupRepo: func(shell *Shell) {
1416
shell.CreateFileAndAdd("file1", "one\ntwo\n")
1517
shell.Commit("one")

0 commit comments

Comments
 (0)