From 257f589e229b773c590b490ec4e893eb8fe25bdb Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 26 Dec 2013 10:40:22 +0000 Subject: [PATCH] Add D for erasing with concatenated yanking --- src/normal.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/normal.cc b/src/normal.cc index 4922b70f..14ff7b40 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -631,6 +631,17 @@ void erase_selections(Context& context, int) erase(context.buffer(), context.selections()); } +void cat_erase_selections(Context& context, int) +{ + auto sels = context.selections_content(); + String str; + for (auto& sel : sels) + str += sel; + RegisterManager::instance()['"'] = memoryview(str); + erase(context.buffer(), context.selections()); +} + + void change(Context& context, int param) { RegisterManager::instance()['"'] = context.selections_content(); @@ -1253,6 +1264,7 @@ KeyMap keymap = { alt('F'), select_to_next_char }, { 'd', erase_selections }, + { 'D', cat_erase_selections }, { 'c', change }, { 'i', enter_insert_mode }, { 'I', enter_insert_mode },