summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-07-02 14:03:20 +0100
committerMaxime Coste <frrrwww@gmail.com>2013-07-02 19:48:04 +0100
commit6484fead0cae74ca2e1eb5a73be3fa1e5f17cece (patch)
treebfd11dfe3f06534c8eedaf2459746cc39fa0a118 /src/normal.cc
parentc1b2f7ef6aa0b4f164a5b56051a12fcc503ebdaa (diff)
replace with char only replaces when entered character is printable
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 91aedfeb..45cc8638 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -201,6 +201,8 @@ void view_commands(Context& context)
void replace_with_char(Context& context)
{
context.input_handler().on_next_key([](const Key& key, Context& context) {
+ if (not isprint(key.key))
+ return;
Editor& editor = context.editor();
SelectionList sels = editor.selections();
auto restore_sels = on_scope_end([&]{ editor.select(std::move(sels)); });