diff --git a/src/buffer.cc b/src/buffer.cc index 22f4a794..2de29b97 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -107,6 +107,12 @@ void Buffer::on_registered() options().register_watcher(*this); + if (m_flags & Buffer::Flags::NoHooks) + { + on_option_changed(options()["readonly"]); + return; + } + run_hook_in_own_context("BufCreate", m_name); if (m_flags & Flags::File) diff --git a/src/main.cc b/src/main.cc index 555f5eba..088f9c0f 100644 --- a/src/main.cc +++ b/src/main.cc @@ -772,7 +772,7 @@ int run_filter(StringView keystr, StringView commands, ConstArrayViewname() + suffix_backup); apply_to_buffer(*buffer); @@ -782,7 +782,7 @@ int run_filter(StringView keystr, StringView commands, ConstArrayView