mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 02:45:39 +00:00
Problem: Cannot use "g<" mapping with ext_messages. Mapping displays
the scrollback buffer since the last command, but the
scrollback buffer is not populated with ext_messages.
Solution: With ext_messages; store messages in the history that otherwise
wouldn't be. Mark them as temporary messages to be deleted when
the scrollback buffer would be cleared. To this end, make the
message history a doubly-linked list such that messages can be
removed from an arbitrary position.
Outlook: Default ext_messages UI might not show the hit-enter prompt
so we want "g<" to work as a recommended way to show messages
for the last command (prompted by an indicator).
22 lines
543 B
C
22 lines
543 B
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "nvim/api/private/defs.h"
|
|
|
|
typedef struct {
|
|
String text;
|
|
int hl_id;
|
|
} HlMessageChunk;
|
|
|
|
typedef kvec_t(HlMessageChunk) HlMessage;
|
|
|
|
/// Message history for `:messages`
|
|
typedef struct msg_hist {
|
|
struct msg_hist *next; ///< Next message.
|
|
struct msg_hist *prev; ///< Previous message.
|
|
HlMessage msg; ///< Highlighted message.
|
|
const char *kind; ///< Message kind (for msg_ext)
|
|
bool temp; ///< Temporary message since last command ("g<")
|
|
} MessageHistoryEntry;
|