mirror of
https://github.com/neovim/neovim.git
synced 2026-05-27 15:25:33 +00:00
Problem: Currently, there's no way to distinguish progress messages coming from different sources. Nor can Progress event be easily filtered based on source. Solution: - Add "source" field to nvim_echo-opts. - The Progress event pattern is now defined by the "source" field. - Include the "title" as ev.data. - Unrelated change: set force=false to disable nesting.
32 lines
1.1 KiB
C
32 lines
1.1 KiB
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;
|
|
#define MsgID Union(Integer, String)
|
|
|
|
typedef struct msg_data {
|
|
String source; ///< Source of progress message
|
|
Integer percent; ///< Progress percentage
|
|
String title; ///< Title for progress message
|
|
String status; ///< Status for progress message
|
|
DictOf(String, Object) data; ///< Extra info for 'echo' messages
|
|
} MessageData;
|
|
/// Message history for `:messages`
|
|
typedef struct msg_hist {
|
|
struct msg_hist *next; ///< Next message.
|
|
struct msg_hist *prev; ///< Previous message.
|
|
HlMessage msg; ///< Highlighted message.
|
|
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;
|