From 4c552af3a2cad81376d99d9e2c2f3a07b506e3c5 Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Wed, 26 Nov 2014 23:39:46 +0100
Subject: [PATCH] Yank alway also into default register "".

---
 doc/vimb.1    | 19 +++++++++++--------
 src/command.c |  6 ++++--
 src/main.h    |  3 ++-
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/doc/vimb.1 b/doc/vimb.1
index eebb223..aa0ff33 100644
--- a/doc/vimb.1
+++ b/doc/vimb.1
@@ -317,8 +317,8 @@ Yank hint's destination location into primary and secondary clipboard and into
 the register \fIx\fP.
 .TP
 .BI [ \[char34]x ];Y
-Yank hint's text description or form text into primary and secondary
-clipboard and into the register \fIx\fP.
+Yank hint's text description or form text into primary and secondary clipboard
+and into the register \fIx\fP.
 .PD
 .RE
 .TP
@@ -399,7 +399,7 @@ Moves the cursor after the char in inputbox.
 .B CTRL\-V
 Pass the next key press directly to gtk.
 .TP
-.B CTRL\-R {a-z%:/;}
+.B CTRL\-R {a-z"%:/;}
 Insert the content of given register at cursor position. See also section
 REGISTERS.
 .SS Command Line History
@@ -767,14 +767,17 @@ Registers:
 .BR \[char34]a " - " \[char34]z
 26 named registers "a to "z. Vimb fills these registers only when you say so.
 .TP
-.B \[char34]%
-Contains the curent opened URI.
-.TP
 .B \[char34]:
-Contains the most recent executed ex command.
+Last executed ex command.
+.TP
+.B \[char34]"
+Last yanked content.
+.TP
+.B \[char34]%
+Curent opened URI.
 .TP
 .B \[char34]/
-Contains the most recent search-pattern.
+Last search phrase.
 .TP
 .B \[char34];
 Contains the last hinted URL. This can be used in `x-hint-command' to get the
diff --git a/src/command.c b/src/command.c
index 4e90e09..fa42f35 100644
--- a/src/command.c
+++ b/src/command.c
@@ -103,8 +103,9 @@ gboolean command_yank(const Arg *arg, char buf)
             text = gtk_clipboard_wait_for_text(SECONDARY_CLIPBOARD());
         }
         if (text) {
-            /* put the text into the yank buffer */
+            /* save in given register and default "" register */
             vb_register_add(buf, text);
+            vb_register_add('"', text);
             vb_echo(VB_MSG_NORMAL, false, tmpl, text);
             g_free(text);
 
@@ -123,9 +124,10 @@ gboolean command_yank(const Arg *arg, char buf)
         a.s = arg->s;
     }
     if (a.s) {
-        /* put the text into the yank buffer */
         vb_set_clipboard(&a);
+        /* save in given register and default "" register */
         vb_register_add(buf, a.s);
+        vb_register_add('"', a.s);
         vb_echo(VB_MSG_NORMAL, false, tmpl, a.s);
 
         return true;
diff --git a/src/main.h b/src/main.h
index d22c369..4c480b7 100644
--- a/src/main.h
+++ b/src/main.h
@@ -115,7 +115,8 @@
 #define VB_MARK_SIZE    (sizeof(VB_MARK_CHARS) - 1)
 
 #define VB_USER_REG     "abcdefghijklmnopqrstuvwxyz"
-#define VB_REG_CHARS    VB_USER_REG "%:/;"
+/* registers in order displayed for :register command */
+#define VB_REG_CHARS    "\"" VB_USER_REG ":%/;"
 #define VB_REG_SIZE     (sizeof(VB_REG_CHARS) - 1)
 
 /* enums */
-- 
2.20.1