summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2016-12-21 06:39:58 +0000
committerMaxime Coste <mawww@kakoune.org>2016-12-21 06:39:58 +0000
commit62df6dbb46ce00be1031e907d222116864431888 (patch)
tree3a5193001ede690e4144d78b5dfaa28b355f3d34 /src/input_handler.cc
parent3a6167ae626a27d8920e0596065c29450461b3ad (diff)
Display a message when entering insert mode while readonly
Fixes #1050
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc5
1 files changed, 5 insertions, 0 deletions
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<bool>())
+ context().print_status({ "Entering insert mode while readonly",
+ get_face("Information") });
}
~Insert()