mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
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)
This commit is contained in:
18
src/ops.c
18
src/ops.c
@@ -3167,19 +3167,29 @@ op_yank(oparg_T *oap, int deleting, int mess)
|
||||
/* 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user