diff --git a/history.go b/history.go index c28430a..81a8705 100644 --- a/history.go +++ b/history.go @@ -38,6 +38,10 @@ func newFileHistory() (*fileHistory, error) { } func (h *fileHistory) Write(line string) (int, error) { + if line == "" { + return len(h.items), nil + } + _, err := h.f.WriteString(line + "\n") if err != nil { return 0, err