On Mo, 16 Nov 2015, Christian Brabandt wrote:
> So how about adding some warning into the documentation that putting
> from the same register that is used for recording won't likely work as
> one would expect and perhaps also mention in the status line which
> register is used for recording (e.g. instead of "recording" use
> "recording @a" or similar, possibly with an 'shortmess' option to
> disable it)? Would that be an acceptable compromise?

Here is a patch.

Best,
Christian
-- 
Wie viel vermag nicht die Übung! Die Zuschauer schreien, und der 
Geschlagne schweigt.
                -- Goethe, Maximen und Reflektionen, Nr. 706

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -6528,6 +6528,7 @@ A jump table for the options with a shor
 	  c	don't give |ins-completion-menu| messages.  For example,
 		"-- XXX completion (YYY)", "match 1 of 2", "The only match",
 		"Pattern not found", "Back at original", etc.
+	  q     use "recording" instead of "recording @a"
 
 	This gives you the opportunity to avoid that a change between buffers
 	requires you to hit <Enter>, but still gives as useful a message as
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -109,7 +109,13 @@ 3. Complex repeats					*complex-repeat*
 q{0-9a-zA-Z"}		Record typed characters into register {0-9a-zA-Z"}
 			(uppercase to append).  The 'q' command is disabled
 			while executing a register, and it doesn't work inside
-			a mapping and |:normal|.  {Vi: no recording}
+			a mapping and |:normal|.
+
+			Note: If the register being used for recording is also
+			used for |y| and |p| the result is most likely not
+			what is expected, because the put will paste the
+			recorded macro and the yank will overwrite the
+			recorded macro. {Vi: no recording}
 
 q			Stops recording.  (Implementation note: The 'q' that
 			stops recording is not stored in the register, unless
diff --git a/src/ops.c b/src/ops.c
--- a/src/ops.c
+++ b/src/ops.c
@@ -1102,7 +1102,7 @@ do_record(c)
 	    retval = FAIL;
 	else
 	{
-	    Recording = TRUE;
+	    Recording = c;
 	    showmode();
 	    regname = c;
 	    retval = OK;
diff --git a/src/option.h b/src/option.h
--- a/src/option.h
+++ b/src/option.h
@@ -213,7 +213,8 @@
 #define SHM_ATTENTION	'A'		/* no ATTENTION messages */
 #define SHM_INTRO	'I'		/* intro messages */
 #define SHM_COMPLETIONMENU  'c'		/* completion menu messages */
-#define SHM_ALL		"rmfixlnwaWtToOsAIc" /* all possible flags for 'shm' */
+#define SHM_RECORDING	'q'		/* short recording message */
+#define SHM_ALL		"rmfixlnwaWtToOsAIcq" /* all possible flags for 'shm' */
 
 /* characters for p_go: */
 #define GO_ASEL		'a'		/* autoselect */
diff --git a/src/screen.c b/src/screen.c
--- a/src/screen.c
+++ b/src/screen.c
@@ -10164,6 +10164,12 @@ showmode()
 		)
 	{
 	    MSG_PUTS_ATTR(_("recording"), attr);
+	    if (!shortmess(SHM_RECORDING))
+	    {
+		char_u s[4];
+		sprintf((char *)s, " @%c", Recording);
+		MSG_PUTS_ATTR(s, attr);
+	    }
 	    need_clear = TRUE;
 	}
 
@@ -10227,7 +10233,15 @@ unshowmode(force)
     {
 	msg_pos_mode();
 	if (Recording)
+	{
 	    MSG_PUTS_ATTR(_("recording"), hl_attr(HLF_CM));
+	    if (!shortmess(SHM_RECORDING))
+	    {
+		char_u s[4];
+		sprintf((char *)s, " @%c", Recording);
+		MSG_PUTS_ATTR(s, hl_attr(HLF_CM));
+	    }
+	}
 	msg_clr_eos();
     }
 }

Raspunde prin e-mail lui