Ensure <esc> cancels in replace with char

After recent changes that associated <esc> with the 0x1b codepoint
r<esc> would replace each char with 0x1b instead of canceling the
replace command.
This commit is contained in:
Maxime Coste 2017-01-02 04:03:02 +00:00
parent 3c1f606a22
commit ac1192f58a

View File

@ -307,7 +307,7 @@ void replace_with_char(Context& context, NormalParams)
on_next_key_with_autoinfo(context, KeymapMode::None,
[](Key key, Context& context) {
auto cp = key.codepoint();
if (not cp)
if (not cp or key == Key::Escape)
return;
ScopedEdition edition(context);
Buffer& buffer = context.buffer();