From e7b4217762c3d75057c491ebda9ce89222fdc33a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 4 Aug 2015 23:02:40 +0100 Subject: [PATCH] Support flags getting modified by hooks at buffer creation Fixes #361 --- src/buffer.cc | 3 ++- src/buffer_utils.cc | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/buffer.cc b/src/buffer.cc index 7acdabba..3f76f20c 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -55,7 +55,8 @@ Buffer::Buffer(String name, Flags flags, BufferLines lines, run_hook_in_own_context("BufCreate", m_name); // now we may begin to record undo data - m_flags = flags; + if (not (flags & Flags::NoUndo)) + m_flags &= ~Flags::NoUndo; for (auto& option : options().flatten_options()) on_option_changed(*option); diff --git a/src/buffer_utils.cc b/src/buffer_utils.cc index 9f8f8860..c6795fe1 100644 --- a/src/buffer_utils.cc +++ b/src/buffer_utils.cc @@ -119,6 +119,8 @@ Buffer* create_fifo_buffer(String name, int fd, bool scroll) if (mode != EventMode::Normal) return; + kak_assert(buffer->flags() & Buffer::Flags::Fifo); + constexpr size_t buffer_size = 2048; // if we read data slower than it arrives in the fifo, limiting the // iteration number allows us to go back go back to the event loop and