From c74b44f54070b82e303fad8253039ec99ec9a891 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 12 Dec 2012 13:52:34 +0100 Subject: [PATCH] change replace char behaviour, now replace each selected chars --- src/main.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index 869dc75c..46199734 100644 --- a/src/main.cc +++ b/src/main.cc @@ -99,7 +99,11 @@ void do_go(Context& context) void do_replace_with_char(Context& context) { context.input_handler().on_next_key([](const Key& key, Context& context) { - context.editor().insert(String() + key.key, InsertMode::Replace); + Editor& editor = context.editor(); + SelectionList sels = editor.selections(); + auto restore_sels = on_scope_end([&]{ editor.select(std::move(sels)); }); + editor.multi_select(std::bind(select_all_matches, _1, ".")); + editor.insert(String() + key.key, InsertMode::Replace); }); }