1
1
mirror of https://github.com/walles/moar.git synced 2024-10-26 13:00:40 +03:00

Merge pull request #163 from Wallunen/fix-rendering-of-whitespace-lines

Fix rendering of whitespace lines
This commit is contained in:
Johan Walles 2023-10-14 08:38:27 +02:00 committed by GitHub
commit 9c2f1ca57f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View File

@ -416,11 +416,6 @@ func renderLine(row []Cell) (string, int) {
}
row = row[0 : lastSignificantCellIndex+1]
if lastSignificantCellIndex < 0 {
// The entire line is whitespace, no need to render it
return "", 0
}
var builder strings.Builder
// Set initial line style to normal

View File

@ -78,7 +78,7 @@ func TestRenderLineEmpty(t *testing.T) {
rendered, count := renderLine(row)
assert.Equal(t, count, 0)
assert.Equal(t, rendered, "")
assert.Equal(t, rendered, "\x1b[m\x1b[K")
}
func TestRenderLineLastReversed(t *testing.T) {
@ -152,7 +152,7 @@ func TestRenderLineOnlyTrailingSpaces(t *testing.T) {
rendered, count := renderLine(row)
assert.Equal(t, count, 0)
assert.Equal(t, rendered, "")
assert.Equal(t, rendered, "\x1b[m\x1b[K")
}
func TestRenderLineLastReversedSpaces(t *testing.T) {