faketerm diff: only print cells with differences.

This commit is contained in:
Jakub Sobon 2020-11-24 15:18:50 -05:00
parent e4edc8f15a
commit 765556fe8e
No known key found for this signature in database
GPG Key ID: F2451A77FB05D3B7
1 changed files with 3 additions and 0 deletions

View File

@ -100,6 +100,9 @@ func Diff(want, got *Terminal) string {
for col := 0; col < size.X; col++ {
got := got.BackBuffer()[col][row].Rune
want := want.BackBuffer()[col][row].Rune
if got == want {
continue
}
b.WriteString(fmt.Sprintf(" cell(%v, %v) => got '%c' (rune %d), want '%c' (rune %d)\n", col, row, got, got, want, want))
}
}