From 2ef4f83358e7b6fd1662cb2fe7480623d5df4fd3 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Wed, 19 Feb 2020 17:40:54 -0500 Subject: [PATCH] Fix issue with simultaneous buffers --- internal/buffer/buffer.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/buffer/buffer.go b/internal/buffer/buffer.go index 87bf8c01..0ad09a7e 100644 --- a/internal/buffer/buffer.go +++ b/internal/buffer/buffer.go @@ -281,15 +281,15 @@ func NewBuffer(r io.Reader, size int64, path string, startcursor Loc, btype BufT b.LineArray = NewLineArray(uint64(size), FFAuto, reader) } b.EventHandler = NewEventHandler(b.SharedBuffer, b.cursors) + + // The last time this file was modified + b.UpdateModTime() } if b.Settings["readonly"].(bool) && b.Type == BTDefault { b.Type.Readonly = true } - // The last time this file was modified - b.UpdateModTime() - switch b.Endings { case FFUnix: b.Settings["fileformat"] = "unix" @@ -319,7 +319,7 @@ func NewBuffer(r io.Reader, size int64, path string, startcursor Loc, btype BufT b.AddCursor(NewCursor(b, b.StartCursor)) b.GetActiveCursor().Relocate() - if !b.Settings["fastdirty"].(bool) { + if !b.Settings["fastdirty"].(bool) && !found { if size > LargeFileThreshold { // If the file is larger than LargeFileThreshold fastdirty needs to be on b.Settings["fastdirty"] = true