replace with char only replaces when entered character is printable
This commit is contained in:
parent
c1b2f7ef6a
commit
6484fead0c
|
@ -201,6 +201,8 @@ void view_commands(Context& context)
|
||||||
void replace_with_char(Context& context)
|
void replace_with_char(Context& context)
|
||||||
{
|
{
|
||||||
context.input_handler().on_next_key([](const Key& key, Context& context) {
|
context.input_handler().on_next_key([](const Key& key, Context& context) {
|
||||||
|
if (not isprint(key.key))
|
||||||
|
return;
|
||||||
Editor& editor = context.editor();
|
Editor& editor = context.editor();
|
||||||
SelectionList sels = editor.selections();
|
SelectionList sels = editor.selections();
|
||||||
auto restore_sels = on_scope_end([&]{ editor.select(std::move(sels)); });
|
auto restore_sels = on_scope_end([&]{ editor.select(std::move(sels)); });
|
||||||
|
|
Loading…
Reference in New Issue
Block a user