robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. Keyesfix(progress): ins-compl progress-msg during pum #41226b53c00b425

master
2.3 KiB68 linesraw
1#pragma once
2
3#include <errno.h>
4#include <stdbool.h>
5#include <stddef.h>  // IWYU pragma: keep
6
7#include "nvim/ex_cmds_defs.h"  // IWYU pragma: keep
8#include "nvim/grid_defs.h"
9#include "nvim/keycodes_defs.h"  // IWYU pragma: keep
10#include "nvim/macros_defs.h"
11#include "nvim/message_defs.h"  // IWYU pragma: keep
12
13/// Types of dialogs passed to do_dialog().
14enum {
15  VIM_GENERIC   = 0,
16  VIM_ERROR     = 1,
17  VIM_WARNING   = 2,
18  VIM_INFO      = 3,
19  VIM_QUESTION  = 4,
20  VIM_LAST_TYPE = 4,  ///< sentinel value
21};
22
23/// Return values for functions like vim_dialogyesno()
24enum {
25  VIM_YES        = 2,
26  VIM_NO         = 3,
27  VIM_CANCEL     = 4,
28  VIM_ALL        = 5,
29  VIM_DISCARDALL = 6,
30};
31
32extern MessageHistoryEntry *msg_hist_last;
33
34EXTERN bool msg_ext_need_clear INIT( = false);
35/// Set to true to force grouping a set of message chunks into a single `cmdline_show` event.
36EXTERN bool msg_ext_skip_flush INIT( = false);
37/// Set to true when previous message should be overwritten.
38EXTERN bool msg_ext_overwrite INIT( = false);
39/// Set to true to avoid setting "verbose" kind for "last set" messages.
40EXTERN bool msg_ext_skip_verbose INIT( = false);
41/// Set to false for non-internal messages to determine UI callback |api-fast| context.
42EXTERN bool msg_ext_fast INIT( = true);
43
44/// allocated grid for messages. Used unless ext_messages is active.
45/// See also the description at msg_scroll_flush()
46EXTERN ScreenGrid msg_grid INIT( = SCREEN_GRID_INIT);
47EXTERN int msg_grid_pos INIT( = 0);
48
49/// "adjusted" message grid. This grid accepts positions relative to
50/// default_grid. Internally it will be translated to a position on msg_grid
51/// relative to the start of the message area, or directly mapped to default_grid
52/// for legacy (display-=msgsep) message scroll behavior.
53/// TODO(bfredl): refactor "internal" message logic, msg_row etc
54/// to use the correct positions already.
55EXTERN GridView msg_grid_adj INIT( = { 0 });
56
57/// value of msg_scrolled at latest msg_scroll_flush.
58EXTERN int msg_scrolled_at_flush INIT( = 0);
59
60EXTERN int msg_grid_scroll_discount INIT( = 0);
61
62EXTERN int msg_listdo_overwrite INIT( = 0);
63
64#include "message.h.generated.h"
65
66// Prefer using semsg(), because perror() may send the output to the wrong
67// destination and mess up the screen.
68#define PERROR(msg) (void)semsg("%s: %s", (msg), strerror(errno))