From e7ef81ed9776b78e91c414a0f88788c48cfc3373 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Wed, 12 Feb 2020 13:32:42 -0500 Subject: [PATCH] Share hash across equivalent buffers for fastdirty=off --- internal/buffer/buffer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/buffer/buffer.go b/internal/buffer/buffer.go index e7aec4a3..c8dbb84c 100644 --- a/internal/buffer/buffer.go +++ b/internal/buffer/buffer.go @@ -82,6 +82,9 @@ type SharedBuffer struct { // Modifications is the list of modified regions for syntax highlighting Modifications []Loc + + // Hash of the original buffer -- empty if fastdirty is on + origHash [md5.Size]byte } func (b *SharedBuffer) insert(pos Loc, value []byte) { @@ -138,9 +141,6 @@ type Buffer struct { Highlighter *highlight.Highlighter HighlightLock sync.Mutex - // Hash of the original buffer -- empty if fastdirty is on - origHash [md5.Size]byte - // Settings customized by the user Settings map[string]interface{}