diff src/screen.c @ 7233:9487ea110214 v7.4.925

commit https://github.com/vim/vim/commit/a0ed84a26897c994512873a895b9fc54e90c6845 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 19 17:56:13 2015 +0100 patch 7.4.925 Problem: User may yank or put using the register being recorded in. Solution: Add the recording register in the message. (Christian Brabandt, closes #470)
author Christian Brabandt <cb@256bit.org>
date Thu, 19 Nov 2015 18:00:05 +0100
parents 2c00f6b312bf
children 6fcadba9ec7a
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -163,6 +163,7 @@ static void redraw_block __ARGS((int row
 static int win_do_lines __ARGS((win_T *wp, int row, int line_count, int mayclear, int del));
 static void win_rest_invalid __ARGS((win_T *wp));
 static void msg_pos_mode __ARGS((void));
+static void recording_mode __ARGS((int attr));
 #if defined(FEAT_WINDOWS)
 static void draw_tabline __ARGS((void));
 #endif
@@ -10163,7 +10164,7 @@ showmode()
 #endif
 		)
 	{
-	    MSG_PUTS_ATTR(_("recording"), attr);
+	    recording_mode(attr);
 	    need_clear = TRUE;
 	}
 
@@ -10227,11 +10228,24 @@ unshowmode(force)
     {
 	msg_pos_mode();
 	if (Recording)
-	    MSG_PUTS_ATTR(_("recording"), hl_attr(HLF_CM));
+	    recording_mode(hl_attr(HLF_CM));
 	msg_clr_eos();
     }
 }
 
+    static void
+recording_mode(attr)
+    int attr;
+{
+    MSG_PUTS_ATTR(_("recording"), attr);
+    if (!shortmess(SHM_RECORDING))
+    {
+	char_u s[4];
+	sprintf((char *)s, " @%c", Recording);
+	MSG_PUTS_ATTR(s, attr);
+    }
+}
+
 #if defined(FEAT_WINDOWS)
 /*
  * Draw the tab pages line at the top of the Vim window.