aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rwxr-xr-xsrc/clint.py3
-rw-r--r--src/nvim/api/private/helpers.h4
-rw-r--r--src/nvim/channel_defs.h9
-rw-r--r--src/nvim/ex_cmds.h18
-rw-r--r--src/nvim/ex_cmds_defs.h18
-rw-r--r--src/nvim/generators/gen_api_dispatch.lua2
-rw-r--r--src/nvim/log.h1
-rw-r--r--src/nvim/message.h34
-rw-r--r--src/nvim/message_defs.h34
-rw-r--r--src/nvim/option.h1
-rw-r--r--src/nvim/os/lang.c1
12 files changed, 60 insertions, 66 deletions
diff --git a/Makefile b/Makefile
index 6176f3a7bf..c1b8518838 100644
--- a/Makefile
+++ b/Makefile
@@ -147,7 +147,6 @@ iwyu: build/.ran-cmake
|src/nvim/buffer.h\
|src/nvim/buffer_defs.h\
|src/nvim/channel.h\
- |src/nvim/channel_defs.h\
|src/nvim/charset.h\
|src/nvim/drawline.h\
|src/nvim/eval.h\
diff --git a/src/clint.py b/src/clint.py
index 537406cd24..446593303b 100755
--- a/src/clint.py
+++ b/src/clint.py
@@ -905,7 +905,6 @@ def CheckIncludes(filename, lines, error):
"src/nvim/buffer.h",
"src/nvim/buffer_defs.h",
"src/nvim/channel.h",
- "src/nvim/channel_defs.h",
"src/nvim/charset.h",
"src/nvim/drawline.h",
"src/nvim/eval.h",
@@ -950,8 +949,6 @@ def CheckIncludes(filename, lines, error):
"klib/klist.h",
"klib/kvec.h",
"nvim/func_attr.h",
- "nvim/gettext.h",
- "nvim/globals.h"
]
for i in check_includes_ignore:
diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h
index 64558f0410..701ce91257 100644
--- a/src/nvim/api/private/helpers.h
+++ b/src/nvim/api/private/helpers.h
@@ -5,9 +5,9 @@
#include "klib/kvec.h"
#include "nvim/api/private/defs.h"
+#include "nvim/buffer_defs.h" // IWYU pragma: keep
+#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/ex_eval_defs.h"
-#include "nvim/gettext.h"
-#include "nvim/globals.h"
#include "nvim/macros_defs.h"
#include "nvim/map_defs.h"
#include "nvim/message_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/channel_defs.h b/src/nvim/channel_defs.h
index 1af4c2de59..f6475129ff 100644
--- a/src/nvim/channel_defs.h
+++ b/src/nvim/channel_defs.h
@@ -4,18 +4,11 @@
#include <stdlib.h>
#include "nvim/eval/typval_defs.h"
-#include "nvim/event/libuv_process.h"
-#include "nvim/event/multiqueue.h"
-#include "nvim/event/process.h"
-#include "nvim/event/socket.h"
-#include "nvim/event/stream.h"
+#include "nvim/event/defs.h"
#include "nvim/garray_defs.h"
#include "nvim/macros_defs.h"
-#include "nvim/main.h"
#include "nvim/map_defs.h"
#include "nvim/msgpack_rpc/channel_defs.h"
-#include "nvim/os/pty_process.h"
-#include "nvim/terminal.h"
#include "nvim/types_defs.h"
#define CHAN_STDIO 1
diff --git a/src/nvim/ex_cmds.h b/src/nvim/ex_cmds.h
index 2f576731f4..c3e4a799b5 100644
--- a/src/nvim/ex_cmds.h
+++ b/src/nvim/ex_cmds.h
@@ -2,6 +2,24 @@
#include "nvim/ex_cmds_defs.h" // IWYU pragma: export
+/// flags for do_ecmd()
+enum {
+ ECMD_HIDE = 0x01, ///< don't free the current buffer
+ ECMD_SET_HELP = 0x02, ///< set b_help flag of (new) buffer before opening file
+ ECMD_OLDBUF = 0x04, ///< use existing buffer if it exists
+ ECMD_FORCEIT = 0x08, ///< ! used in Ex command
+ ECMD_ADDBUF = 0x10, ///< don't edit, just add to buffer list
+ ECMD_ALTBUF = 0x20, ///< like ECMD_ADDBUF and set the alternate file
+ ECMD_NOWINENTER = 0x40, ///< do not trigger BufWinEnter
+};
+
+/// for lnum argument in do_ecmd()
+enum {
+ ECMD_LASTL = 0, ///< use last position in loaded file
+ ECMD_LAST = -1, ///< use last position in all files
+ ECMD_ONE = 1, ///< use first line
+};
+
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ex_cmds.h.generated.h"
#endif
diff --git a/src/nvim/ex_cmds_defs.h b/src/nvim/ex_cmds_defs.h
index 5ece6db8e9..cf6282ad06 100644
--- a/src/nvim/ex_cmds_defs.h
+++ b/src/nvim/ex_cmds_defs.h
@@ -230,24 +230,6 @@ typedef struct {
} magic;
} CmdParseInfo;
-/// flags for do_ecmd()
-enum {
- ECMD_HIDE = 0x01, ///< don't free the current buffer
- ECMD_SET_HELP = 0x02, ///< set b_help flag of (new) buffer before opening file
- ECMD_OLDBUF = 0x04, ///< use existing buffer if it exists
- ECMD_FORCEIT = 0x08, ///< ! used in Ex command
- ECMD_ADDBUF = 0x10, ///< don't edit, just add to buffer list
- ECMD_ALTBUF = 0x20, ///< like ECMD_ADDBUF and set the alternate file
- ECMD_NOWINENTER = 0x40, ///< do not trigger BufWinEnter
-};
-
-/// for lnum argument in do_ecmd()
-enum {
- ECMD_LASTL = 0, ///< use last position in loaded file
- ECMD_LAST = -1, ///< use last position in all files
- ECMD_ONE = 1, ///< use first line
-};
-
/// Previous :substitute replacement string definition
typedef struct {
char *sub; ///< Previous replacement string.
diff --git a/src/nvim/generators/gen_api_dispatch.lua b/src/nvim/generators/gen_api_dispatch.lua
index 7cec118243..5928999967 100644
--- a/src/nvim/generators/gen_api_dispatch.lua
+++ b/src/nvim/generators/gen_api_dispatch.lua
@@ -236,6 +236,7 @@ local keysets_defs = io.open(keysets_outputf, 'wb')
output:write([[
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
+#include "nvim/globals.h"
#include "nvim/log.h"
#include "nvim/map_defs.h"
#include "nvim/msgpack_rpc/helpers.h"
@@ -662,6 +663,7 @@ output:write([[
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/func_attr.h"
+#include "nvim/globals.h"
#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/api/private/dispatch.h"
diff --git a/src/nvim/log.h b/src/nvim/log.h
index 0a9a86c905..c6a033c634 100644
--- a/src/nvim/log.h
+++ b/src/nvim/log.h
@@ -1,5 +1,6 @@
#pragma once
+#include "auto/config.h"
#include "nvim/log_defs.h" // IWYU pragma: export
#include "nvim/macros_defs.h"
diff --git a/src/nvim/message.h b/src/nvim/message.h
index 15a83fca2c..63d43fe47e 100644
--- a/src/nvim/message.h
+++ b/src/nvim/message.h
@@ -1,13 +1,36 @@
#pragma once
+#include <errno.h>
#include <stdbool.h>
#include <stddef.h> // IWYU pragma: keep
+#include <stdio.h>
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/grid_defs.h"
#include "nvim/macros_defs.h"
#include "nvim/message_defs.h" // IWYU pragma: export
+/// Types of dialogs passed to do_dialog().
+enum {
+ VIM_GENERIC = 0,
+ VIM_ERROR = 1,
+ VIM_WARNING = 2,
+ VIM_INFO = 3,
+ VIM_QUESTION = 4,
+ VIM_LAST_TYPE = 4, ///< sentinel value
+};
+
+/// Return values for functions like vim_dialogyesno()
+enum {
+ VIM_YES = 2,
+ VIM_NO = 3,
+ VIM_CANCEL = 4,
+ VIM_ALL = 5,
+ VIM_DISCARDALL = 6,
+};
+
+enum { MSG_HIST = 0x1000, }; ///< special attribute addition: Put message in history
+
/// First message
extern MessageHistoryEntry *first_msg_hist;
/// Last message
@@ -38,3 +61,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
diff --git a/src/nvim/message_defs.h b/src/nvim/message_defs.h
index a0237ea78f..67e037fc0f 100644
--- a/src/nvim/message_defs.h
+++ b/src/nvim/message_defs.h
@@ -1,35 +1,12 @@
#pragma once
-#include <errno.h>
#include <stdbool.h>
-#include <stdio.h>
#include "klib/kvec.h"
#include "nvim/api/private/defs.h"
#include "nvim/grid_defs.h"
#include "nvim/macros_defs.h"
-/// Types of dialogs passed to do_dialog().
-enum {
- VIM_GENERIC = 0,
- VIM_ERROR = 1,
- VIM_WARNING = 2,
- VIM_INFO = 3,
- VIM_QUESTION = 4,
- VIM_LAST_TYPE = 4, ///< sentinel value
-};
-
-/// Return values for functions like vim_dialogyesno()
-enum {
- VIM_YES = 2,
- VIM_NO = 3,
- VIM_CANCEL = 4,
- VIM_ALL = 5,
- VIM_DISCARDALL = 6,
-};
-
-enum { MSG_HIST = 0x1000, }; ///< special attribute addition: Put message in history
-
typedef struct {
String text;
int attr;
@@ -46,14 +23,3 @@ typedef struct msg_hist {
bool multiline; ///< Multiline message.
HlMessage multiattr; ///< multiattr message.
} MessageHistoryEntry;
-
-// 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
diff --git a/src/nvim/option.h b/src/nvim/option.h
index 44cba70302..2e4186fe7f 100644
--- a/src/nvim/option.h
+++ b/src/nvim/option.h
@@ -1,5 +1,6 @@
#pragma once
+#include <assert.h>
#include <stdint.h>
#include <stdio.h> // IWYU pragma: keep
diff --git a/src/nvim/os/lang.c b/src/nvim/os/lang.c
index 17d179a56a..20b60150ee 100644
--- a/src/nvim/os/lang.c
+++ b/src/nvim/os/lang.c
@@ -20,6 +20,7 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/garray.h"
#include "nvim/gettext.h"
+#include "nvim/globals.h"
#include "nvim/macros_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"