diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-12-26 10:40:22 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-12-26 10:40:22 +0000 |
| commit | 257f589e229b773c590b490ec4e893eb8fe25bdb (patch) | |
| tree | cea1ecc6312bcbb204d5be7f56cdb505941fcc09 /src | |
| parent | 983abefc30facb1b30d6bed1ee91b71e5602042d (diff) | |
Add D for erasing with concatenated yanking
Diffstat (limited to 'src')
| -rw-r--r-- | src/normal.cc | 12 |
1 files changed, 12 insertions, 0 deletions
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<String>(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<SelectFlags::Inclusive | SelectFlags::Extend | SelectFlags::Reverse> }, { 'd', erase_selections }, + { 'D', cat_erase_selections }, { 'c', change }, { 'i', enter_insert_mode<InsertMode::Insert> }, { 'I', enter_insert_mode<InsertMode::InsertAtLineBegin> }, |
