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:
commit
9c2f1ca57f
@ -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
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user