From 01c4e90c3576b48993f8595eea7fa47c82c2adcb Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sun, 1 Oct 2017 22:53:35 -0500 Subject: [PATCH] Bugfix in rewriteHistory (#121) Previously, rewriteHistory was incorrect - it did not preserve the newlines between history lines, which corrupts the history file. --- history.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/history.go b/history.go index b154aed..58c4186 100644 --- a/history.go +++ b/history.go @@ -117,7 +117,7 @@ func (o *opHistory) rewriteLocked() { buf := bufio.NewWriter(fd) for elem := o.history.Front(); elem != nil; elem = elem.Next() { - buf.WriteString(string(elem.Value.(*hisItem).Source)) + buf.WriteString(string(elem.Value.(*hisItem).Source) + "\n") } buf.Flush()