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)
diff --git a/src/ops.c b/src/ops.c
index 2aec5d4..05ccc81 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -3167,19 +3167,29 @@
/* 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);
}
}