message.h
Go to the documentation of this file.
1 #ifndef NVIM_MESSAGE_H
2 #define NVIM_MESSAGE_H
3 
4 #include <stdarg.h>
5 #include <stdbool.h>
6 #include <stddef.h>
7 
9 #include "nvim/grid_defs.h"
10 #include "nvim/lib/kvec.h"
11 #include "nvim/macros.h"
12 #include "nvim/types.h"
13 
14 /*
15  * Types of dialogs passed to do_dialog().
16  */
17 #define VIM_GENERIC 0
18 #define VIM_ERROR 1
19 #define VIM_WARNING 2
20 #define VIM_INFO 3
21 #define VIM_QUESTION 4
22 #define VIM_LAST_TYPE 4 // sentinel value
23 
24 /*
25  * Return values for functions like vim_dialogyesno()
26  */
27 #define VIM_YES 2
28 #define VIM_NO 3
29 #define VIM_CANCEL 4
30 #define VIM_ALL 5
31 #define VIM_DISCARDALL 6
32 
33 typedef struct {
35  int attr;
37 
38 typedef kvec_t(HlMessageChunk) HlMessage;
39 
41 typedef struct msg_hist {
42  struct msg_hist *next;
44  const char *kind;
45  int attr;
46  bool multiline;
47  HlMessage multiattr;
49 
54 
55 EXTERN bool msg_ext_need_clear INIT(= false);
56 
57 // allocated grid for messages. Used when display+=msgsep is set, or
58 // ext_multigrid is active. See also the description at msg_scroll_flush()
60 EXTERN int msg_grid_pos INIT(= 0);
61 
62 // "adjusted" message grid. This grid accepts positions relative to
63 // default_grid. Internally it will be translated to a position on msg_grid
64 // relative to the start of the message area, or directly mapped to default_grid
65 // for legacy (display-=msgsep) message scroll behavior.
66 // // TODO(bfredl): refactor "internal" message logic, msg_row etc
67 // to use the correct positions already.
68 EXTERN ScreenGrid msg_grid_adj INIT(= SCREEN_GRID_INIT);
69 
70 // value of msg_scrolled at latest msg_scroll_flush.
71 EXTERN int msg_scrolled_at_flush INIT(= 0);
72 
73 #ifdef INCLUDE_GENERATED_DECLARATIONS
74 # include "message.h.generated.h"
75 #endif
76 #endif // NVIM_MESSAGE_H
INIT
EXTERN bool msg_ext_need_clear INIT(=false)
msg_hist::multiattr
HlMessage multiattr
multiattr message.
Definition: message.h:47
types.h
last_msg_hist
MessageHistoryEntry * last_msg_hist
Last message.
Definition: message.c:74
HlMessageChunk::attr
int attr
Definition: message.h:35
HlMessageChunk
Definition: message.h:33
macros.h
grid_defs.h
msg_hist::attr
int attr
Message highlighting.
Definition: message.h:45
defs.h
first_msg_hist
MessageHistoryEntry * first_msg_hist
First message.
Definition: message.c:73
msg_hist
Message history for :messages
Definition: message.h:41
kvec.h
SCREEN_GRID_INIT
#define SCREEN_GRID_INIT
Definition: grid_defs.h:109
String
Definition: defs.h:78
kvec_t
typedef kvec_t(HlMessageChunk) HlMessage
MessageHistoryEntry
struct msg_hist MessageHistoryEntry
Message history for :messages
msg_hist::msg
char_u * msg
Message text.
Definition: message.h:43
EXTERN
#define EXTERN
Definition: macros.h:9
msg_hist::next
struct msg_hist * next
Next message.
Definition: message.h:42
msg_hist::kind
const char * kind
Message kind (for msg_ext)
Definition: message.h:44
msg_hist::multiline
bool multiline
Multiline message.
Definition: message.h:46
char_u
unsigned char char_u
Definition: types.h:12
HlMessageChunk::text
String text
Definition: message.h:34
ScreenGrid
Definition: grid_defs.h:47