From b6979e2d2cb1fe60e94beec0075ed55a26069595 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 8 Jul 2014 20:25:09 +0100 Subject: Add docstring for normal mode commands and display them if autoinfo >= 2 --- src/input_handler.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/input_handler.cc') diff --git a/src/input_handler.cc b/src/input_handler.cc index a440dc1a..2e4a58f8 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -106,7 +106,16 @@ public: } auto it = keymap.find(key); if (it != keymap.end()) - it->second(context(), m_count); + { + if (context().options()["autoinfo"].get() >= 2 and context().has_ui()) + { + ColorPair col = get_color("Information"); + CharCoord pos = context().window().dimensions(); + pos.column -= 1; + context().ui().info_show(key_to_str(key), it->second.docstring, pos, col, MenuStyle::Prompt); + } + it->second.func(context(), m_count); + } m_count = 0; } -- cgit v1.2.3