diff src/ops.c @ 11682:b9928ef8632f v8.0.0724

patch 8.0.0724: the message for yanking doesn't indicate the register commit https://github.com/vim/vim/commit/e45deb79978677cb41f1477ba4140bccff658fd1 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 16 17:56:16 2017 +0200 patch 8.0.0724: the message for yanking doesn't indicate the register Problem: The message for yanking doesn't indicate the register. Solution: Show the register name in the "N lines yanked" message. (Lemonboy, closes #1803, closes #1809)
author Christian Brabandt <cb@256bit.org>
date Sun, 16 Jul 2017 18:00:04 +0200
parents 72b20190dce6
children 570f00932da8
line wrap: on
line diff
--- a/src/ops.c
+++ b/src/ops.c
@@ -3167,19 +3167,29 @@ op_yank(oparg_T *oap, int deleting, int 
 	/* Some versions of Vi use ">=" here, some don't...  */
 	if (yanklines > p_report)
 	{
+	    char namebuf[100];
+
+	    if (oap->regname == NUL)
+		*namebuf = NUL;
+	    else
+		vim_snprintf(namebuf, sizeof(namebuf),
+						   " into \"%c", oap->regname);
+
 	    /* redisplay now, so message is not deleted */
 	    update_topline_redraw();
 	    if (yanklines == 1)
 	    {
 		if (oap->block_mode)
-		    MSG(_("block of 1 line yanked"));
+		    smsg((char_u *)_("block of 1 line yanked%s"), namebuf);
 		else
-		    MSG(_("1 line yanked"));
+		    smsg((char_u *)_("1 line yanked%s"), namebuf);
 	    }
 	    else if (oap->block_mode)
-		smsg((char_u *)_("block of %ld lines yanked"), yanklines);
+		smsg((char_u *)_("block of %ld lines yanked%s"),
+		     yanklines, namebuf);
 	    else
-		smsg((char_u *)_("%ld lines yanked"), yanklines);
+		smsg((char_u *)_("%ld lines yanked%s"), yanklines,
+		     namebuf);
 	}
     }