fix(messages): add append parameter to history entries (#34467)

Problem:  The "append" parameter added in abb40ece is missing from
          history entries, resulting in different message formatting
          for "g<".
Solution: Add "append" field to message history entries.

Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
This commit is contained in:
luukvbaal
2025-06-15 23:36:41 +02:00
committed by GitHub
parent 5ea6a022c0
commit 29f2cb89f0
7 changed files with 30 additions and 16 deletions

View File

@@ -1053,6 +1053,11 @@ static void msg_hist_add_multihl(HlMessage msg, bool temp)
entry->kind = msg_ext_kind;
entry->prev = msg_hist_last;
entry->next = NULL;
// NOTE: this does not encode if the message was actually appended to the
// previous entry in the message history. However append is currently only
// true for :echon, which is stored in the history as a temporary entry for
// "g<" where it is guaranteed to be after the entry it was appended to.
entry->append = msg_ext_append;
if (msg_hist_first == NULL) {
msg_hist_first = entry;
@@ -1206,6 +1211,7 @@ void ex_messages(exarg_T *eap)
ADD(content, ARRAY_OBJ(content_entry));
}
ADD(entry, ARRAY_OBJ(content));
ADD(entry, BOOLEAN_OBJ(p->append));
ADD(entries, ARRAY_OBJ(entry));
}
if (redirecting() || !ui_has(kUIMessages)) {

View File

@@ -18,4 +18,6 @@ typedef struct msg_hist {
HlMessage msg; ///< Highlighted message.
const char *kind; ///< Message kind (for msg_ext)
bool temp; ///< Temporary message since last command ("g<")
bool append; ///< Message should be appended to previous entry, as opposed
///< to on a new line (|ui-messages|->msg_show->append).
} MessageHistoryEntry;