Skip to content

Commit

Permalink
Remove <esc> as end macro recording, Q should be enough
Browse files Browse the repository at this point in the history
Besides being redundant, it is easy to press esc by mistake/habit
while recording a macro.
  • Loading branch information
mawww committed Jul 4, 2022
1 parent df79d0c commit f3cb2e4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/input_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ class Normal : public InputMode

command->func(context(), params);
}
else
m_params = { 0, 0 };
}

context().hooks().run_hook(Hook::NormalKey, key_to_str(key), context());
Expand Down
1 change: 1 addition & 0 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct {
StringView notes;
} constexpr version_notes[] = { {
0,
"» {+b}<esc>{} does not end macro recording anymore, use {+b}Q{}\n"
"» pipe commands do not append final end-of-lines anymore\n"
"» {+u}complete-command{} to configure command completion\n"
"» {+b}!{} and {+b}<a-!>{} now select the inserted text\n"
Expand Down
8 changes: 0 additions & 8 deletions src/normal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1548,12 +1548,6 @@ void start_or_end_macro_recording(Context& context, NormalParams params)
}
}

void end_macro_recording(Context& context, NormalParams)
{
if (context.input_handler().is_recording())
context.input_handler().stop_recording();
}

void replay_macro(Context& context, NormalParams params)
{
const char reg = to_lower(params.reg ? params.reg : '@');
Expand Down Expand Up @@ -2357,8 +2351,6 @@ static constexpr HashMap<Key, NormalCmd, MemoryDomain::Undefined, KeymapBackend>
{ {'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_codepoint<to_lower>} },
{ {'~'}, {"convert to upper case in selections", for_each_codepoint<to_upper>} },
{ {alt('`')}, { "swap case in selections", for_each_codepoint<swap_case>} },
Expand Down

0 comments on commit f3cb2e4

Please sign in to comment.