From aa6ec5987cbeb73476a88f33607e50ff7c4e49f6 Mon Sep 17 00:00:00 2001 From: Taupiqueur Date: Wed, 14 Apr 2021 02:32:21 +0200 Subject: [PATCH] Fix `edit -readonly` command not setting `readonly` option --- src/commands.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commands.cc b/src/commands.cc index 85e45c4b..dd95f0fc 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -393,7 +393,10 @@ void edit(const ParametersParser& parser, Context& context, const ShellContext&) buffer->flags() &= ~Buffer::Flags::NoHooks; if (parser.get_switch("readonly")) + { buffer->flags() |= Buffer::Flags::ReadOnly; + buffer->options()["readonly"].set(true); + } } Buffer* current_buffer = context.has_buffer() ? &context.buffer() : nullptr;