fix(messages): list_cmd kind for buffer line messages (#33855)

Problem:  Missing kind and separate event for each line for message
          containing buffer lines for e.g. `:print`.
Solution: Set the `list_cmd` kind and only `msg_start()` for the first
          message, print a newline instead.
This commit is contained in:
luukvbaal
2025-05-05 14:04:09 +02:00
committed by GitHub
parent 2d75ea6afe
commit 912388f517
3 changed files with 34 additions and 13 deletions

View File

@@ -5129,14 +5129,13 @@ static void ex_print(exarg_T *eap)
if (curbuf->b_ml.ml_flags & ML_EMPTY) {
emsg(_(e_empty_buffer));
} else {
for (; !got_int; os_breakcheck()) {
print_line(eap->line1,
for (linenr_T line = eap->line1; line <= eap->line2 && !got_int; os_breakcheck()) {
print_line(line,
(eap->cmdidx == CMD_number || eap->cmdidx == CMD_pound
|| (eap->flags & EXFLAG_NR)),
eap->cmdidx == CMD_list || (eap->flags & EXFLAG_LIST));
if (++eap->line1 > eap->line2) {
break;
}
eap->cmdidx == CMD_list || (eap->flags & EXFLAG_LIST),
line == eap->line1);
line++;
}
setpcmark();
// put cursor at last line
@@ -6360,7 +6359,7 @@ void ex_may_print(exarg_T *eap)
{
if (eap->flags != 0) {
print_line(curwin->w_cursor.lnum, (eap->flags & EXFLAG_NR),
(eap->flags & EXFLAG_LIST));
(eap->flags & EXFLAG_LIST), true);
ex_no_reprint = true;
}
}