From 9fe4724743a67514cdf8e645243e4a7cf435b1b5 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 30 Jul 2014 01:08:55 +0100 Subject: [PATCH] Stop macro recording on esc in normal mode Fixes #221 --- src/normal.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/normal.cc b/src/normal.cc index e4b7e76f..98ff8ae4 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -971,6 +971,12 @@ void start_or_end_macro_recording(Context& context, int) }, "record macro", "enter macro name "); } +void end_macro_recording(Context& context, int) +{ + if (context.input_handler().is_recording()) + context.input_handler().stop_recording(); +} + void replay_macro(Context& context, int count) { on_next_key_with_autoinfo(context, [count](Key key, Context& context) mutable { @@ -1359,6 +1365,8 @@ KeyMap keymap = { 'q', { "replay recorded macro", replay_macro } }, { 'Q', { "start or end macro recording", start_or_end_macro_recording } }, + { Key::Escape, { "end macro recording", end_macro_recording } }, + { '`', { "convert to lower case in selections", for_each_char } }, { '~', { "convert to upper case in selections", for_each_char } }, { alt('`'), { "swap case in selections", for_each_char } },