refactor: move some constants out of vim_defs.h (#26298)

This commit is contained in:
zeertzjq
2023-11-29 20:32:40 +08:00
committed by GitHub
parent f4001d27ef
commit a6cba103ce
89 changed files with 339 additions and 352 deletions

View File

@@ -1,15 +1,15 @@
#pragma once
#include <stdarg.h>
#include <errno.h>
#include <stdbool.h>
#include <stddef.h>
#include <stddef.h> // IWYU pragma: keep
#include <stdio.h>
#include "klib/kvec.h"
#include "nvim/api/private/defs.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/grid_defs.h"
#include "nvim/macros_defs.h"
#include "nvim/types_defs.h"
/// Types of dialogs passed to do_dialog().
enum {
@@ -30,6 +30,9 @@ enum {
VIM_DISCARDALL = 6,
};
/// special attribute addition: Put message in history
enum { MSG_HIST = 0x1000, };
typedef struct {
String text;
int attr;
@@ -77,3 +80,14 @@ EXTERN int msg_listdo_overwrite INIT( = 0);
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "message.h.generated.h"
#endif
// Prefer using semsg(), because perror() may send the output to the wrong
// destination and mess up the screen.
#define PERROR(msg) (void)semsg("%s: %s", (msg), strerror(errno))
#ifndef MSWIN
/// Headless (no UI) error message handler.
# define os_errmsg(str) fprintf(stderr, "%s", (str))
/// Headless (no UI) message handler.
# define os_msg(str) printf("%s", (str))
#endif