vim-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 vim/vim#1803, closes vim/vim#1809)
e45deb7997
This commit is contained in:
Jan Edmund Lazo
2018-07-17 08:37:41 -04:00
parent cd6e7e8cf3
commit eab17e5093
3 changed files with 41 additions and 5 deletions

View File

@@ -2509,19 +2509,27 @@ static void op_yank_reg(oparg_T *oap, bool message, yankreg_T *reg, bool append)
}
// Some versions of Vi use ">=" here, some don't...
if (yanklines > (size_t)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 (yank_type == kMTBlockWise) {
MSG(_("block of 1 line yanked"));
smsg(_("block of 1 line yanked%s"), namebuf);
} else {
MSG(_("1 line yanked"));
smsg(_("1 line yanked%s"), namebuf);
}
} else if (yank_type == kMTBlockWise) {
smsg(_("block of %" PRId64 " lines yanked"),
(int64_t)yanklines);
smsg(_("block of %" PRId64 " lines yanked%s"),
(int64_t)yanklines, namebuf);
} else {
smsg(_("%" PRId64 " lines yanked"), (int64_t)yanklines);
smsg(_("%" PRId64 " lines yanked%s"), (int64_t)yanklines, namebuf);
}
}
}