Skip to content

Commit fe816c7

Browse files
committed
fixup! Bump gocui
1 parent 6f2984e commit fe816c7

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

pkg/integration/tests/patch_building/move_to_index_part_of_adjacent_added_lines.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ var MoveToIndexPartOfAdjacentAddedLines = NewIntegrationTest(NewIntegrationTestA
6464
)
6565

6666
t.Views().Main().
67-
Content(Contains("+1st line\n 2nd line\n"))
67+
Content(Contains("+1st line\n 2nd line"))
6868
},
6969
})

pkg/integration/tests/stash/stash_staged_partial_file.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ var StashStagedPartialFile = NewIntegrationTest(NewIntegrationTestArgs{
2323

2424
t.Views().Staging().
2525
Content(
26-
Contains(" line1\n-line2\n+line2 mod\n line3\n-line4\n+line4 mod\n"),
26+
Contains(" line1\n-line2\n+line2 mod\n line3\n-line4\n+line4 mod"),
2727
).
2828
PressPrimaryAction().
2929
PressPrimaryAction().
3030
Content(
31-
Contains(" line1\n line2 mod\n line3\n-line4\n+line4 mod\n"),
31+
Contains(" line1\n line2 mod\n line3\n-line4\n+line4 mod"),
3232
).
3333
PressEscape()
3434

@@ -54,7 +54,7 @@ var StashStagedPartialFile = NewIntegrationTest(NewIntegrationTestArgs{
5454
)
5555
t.Views().Main().
5656
Content(
57-
Contains(" line1\n-line2\n+line2 mod\n line3\n line4\n"),
57+
Contains(" line1\n-line2\n+line2 mod\n line3\n line4"),
5858
)
5959

6060
t.Views().Files().
@@ -64,7 +64,7 @@ var StashStagedPartialFile = NewIntegrationTest(NewIntegrationTestArgs{
6464

6565
t.Views().Staging().
6666
Content(
67-
Contains(" line1\n line2\n line3\n-line4\n+line4 mod\n"),
67+
Contains(" line1\n line2\n line3\n-line4\n+line4 mod"),
6868
)
6969
},
7070
})

pkg/utils/lines.go

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ func ScanLinesAndTruncateWhenLongerThanBuffer(maxBufferSize int) func(data []byt
110110
// If wrap is false, the text is returned as is.
111111
// This code needs to behave the same as `gocui.lineWrap` does.
112112
func WrapViewLinesToWidth(wrap bool, text string, width int) ([]string, []int, []int) {
113+
text = strings.TrimSuffix(text, "\n")
113114
lines := strings.Split(text, "\n")
114115
if !wrap {
115116
indices := make([]int, len(lines))

pkg/utils/lines_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,9 @@ func TestWrapViewLinesToWidth(t *testing.T) {
374374
"longer.",
375375
"Third",
376376
"paragraph",
377-
"",
378377
},
379-
expectedWrappedLinesIndices: []int{0, 2, 6, 8},
380-
expectedOriginalLinesIndices: []int{0, 0, 1, 1, 1, 1, 2, 2, 3},
378+
expectedWrappedLinesIndices: []int{0, 2, 6},
379+
expectedOriginalLinesIndices: []int{0, 0, 1, 1, 1, 1, 2, 2},
381380
},
382381
}
383382
for _, tt := range tests {

0 commit comments

Comments
 (0)