From 62df6dbb46ce00be1031e907d222116864431888 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 21 Dec 2016 06:39:58 +0000 Subject: [PATCH] Display a message when entering insert mode while readonly Fixes #1050 --- src/input_handler.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/input_handler.cc b/src/input_handler.cc index 2a6a8b68..19fd0efd 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -1002,6 +1002,11 @@ public: last_insert().disable_hooks = context().hooks_disabled(); context().hooks().run_hook("InsertBegin", "", context()); prepare(m_insert_mode, count); + + if (context().has_client() and + context().options()["readonly"].get()) + context().print_status({ "Entering insert mode while readonly", + get_face("Information") }); } ~Insert()