From d1c8622dc7ac1d0e2ec07fa7034e4396dffb244f Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 25 Oct 2023 12:53:55 +1100 Subject: [PATCH] Clear buffer values on fifo buffer recreation The cached WordDB/Highlighters/FifoReader are not relevant and are better fully rebuilt than updated. This speeds up rebuilding the WordDB of big fifo buffers such as a `git log`. --- src/buffer_utils.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/buffer_utils.cc b/src/buffer_utils.cc index 47f9a88b..6de07c71 100644 --- a/src/buffer_utils.cc +++ b/src/buffer_utils.cc @@ -178,6 +178,7 @@ Buffer* create_fifo_buffer(String name, int fd, Buffer::Flags flags, bool scroll if (buffer) { buffer->flags() |= Buffer::Flags::NoUndo | flags; + buffer->values().clear(); buffer->reload({StringData::create({"\n"})}, ByteOrderMark::None, EolFormat::Lf, {InvalidTime, {}, {}}); } else