more specific comment on why 'w.lineCount > 0' check
Vladimir Bauer
5 years ago
| 38 | 38 |
|
| 39 | 39 |
// Flush flushes the underlying buffer.
|
| 40 | 40 |
func (w *Writer) Flush(lineCount int) (err error) {
|
| 41 | |
// some terminals interpret clear 0 lines as clear 1
|
|
41 |
// some terminals interpret 'cursor up 0' as 'cursor up 1'
|
| 42 | 42 |
if w.lineCount > 0 {
|
| 43 | 43 |
err = w.clearLines()
|
| 44 | 44 |
if err != nil {
|