From 01018a5eaca87799312e1d68687aec4dc7ce630a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 27 Sep 2011 14:15:20 +0000 Subject: [PATCH] Handle paste before and paster after with p and P --- src/main.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.cc b/src/main.cc index 59fbc4ee2..eeddbe56c 100644 --- a/src/main.cc +++ b/src/main.cc @@ -403,9 +403,13 @@ void do_change(Window& window, int count) do_insert(window); } +template void do_paste(Window& window, int count) { - window.append(RegisterManager::instance()['"']); + if (append) + window.append(RegisterManager::instance()['"']); + else + window.insert(RegisterManager::instance()['"']); } std::unordered_map> keymap = @@ -436,7 +440,8 @@ std::unordered_map> keymap { 'g', do_go }, { 'y', do_yank }, - { 'p', do_paste }, + { 'p', do_paste }, + { 'P', do_paste }, { '%', [](Window& window, int count) { window.select(false, [](const BufferIterator& cursor) { return Selection(cursor.buffer().begin(), cursor.buffer().end()-1); }); } },