aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-28 07:47:36 +0800
committerGitHub <noreply@github.com>2023-11-28 07:47:36 +0800
commit718053b7a97c4e2fbaa6077d3c9f4dc7012c8aad (patch)
treeb9dcecd6373c0f9a51c5dde37c2c7c7cf5f43c62 /src
parent6c14ae6bfaf51415b555e9a6b85d1d280976358d (diff)
downloadrneovim-718053b7a97c4e2fbaa6077d3c9f4dc7012c8aad.tar.gz
rneovim-718053b7a97c4e2fbaa6077d3c9f4dc7012c8aad.tar.bz2
rneovim-718053b7a97c4e2fbaa6077d3c9f4dc7012c8aad.zip
refactor: fix runtime_defs.h (#26259)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/clint.py40
-rw-r--r--src/nvim/api/buffer.h4
-rw-r--r--src/nvim/api/command.h2
-rw-r--r--src/nvim/api/extmark.h2
-rw-r--r--src/nvim/api/options.h2
-rw-r--r--src/nvim/api/private/dispatch.h2
-rw-r--r--src/nvim/api/vim.h2
-rw-r--r--src/nvim/api/vimscript.h2
-rw-r--r--src/nvim/api/win_config.h2
-rw-r--r--src/nvim/api/window.h2
-rw-r--r--src/nvim/arglist.h2
-rw-r--r--src/nvim/bufwrite.h2
-rw-r--r--src/nvim/change.h18
-rw-r--r--src/nvim/cmdexpand.h2
-rw-r--r--src/nvim/cursor.h2
-rw-r--r--src/nvim/digraph.h2
-rw-r--r--src/nvim/edit.h46
-rw-r--r--src/nvim/eval/buffer.h2
-rw-r--r--src/nvim/eval/decode.h2
-rw-r--r--src/nvim/eval/funcs.h12
-rw-r--r--src/nvim/eval/vars.h2
-rw-r--r--src/nvim/ex_cmds.h2
-rw-r--r--src/nvim/ex_docmd.h35
-rw-r--r--src/nvim/ex_getln.h6
-rw-r--r--src/nvim/file_search.h2
-rw-r--r--src/nvim/getchar.h2
-rw-r--r--src/nvim/hashtab.h2
-rw-r--r--src/nvim/highlight_group.h2
-rw-r--r--src/nvim/indent.h16
-rw-r--r--src/nvim/indent_c.h2
-rw-r--r--src/nvim/insexpand.h4
-rw-r--r--src/nvim/linematch.h2
-rw-r--r--src/nvim/mapping.c1
-rw-r--r--src/nvim/mapping.h9
-rw-r--r--src/nvim/match.h2
-rw-r--r--src/nvim/mbyte.h2
-rw-r--r--src/nvim/memline.h4
-rw-r--r--src/nvim/menu.h4
-rw-r--r--src/nvim/move.h2
-rw-r--r--src/nvim/option.h2
-rw-r--r--src/nvim/os/fs.h2
-rw-r--r--src/nvim/os/lang.h6
-rw-r--r--src/nvim/path.h2
-rw-r--r--src/nvim/plines.h2
-rw-r--r--src/nvim/profile.h2
-rw-r--r--src/nvim/quickfix.h14
-rw-r--r--src/nvim/regexp.h4
-rw-r--r--src/nvim/regexp_defs.h95
-rw-r--r--src/nvim/runtime.c25
-rw-r--r--src/nvim/runtime.h43
-rw-r--r--src/nvim/runtime_defs.h46
-rw-r--r--src/nvim/sign.h2
-rw-r--r--src/nvim/strings.h8
-rw-r--r--src/nvim/testing.h2
-rw-r--r--src/nvim/textformat.h2
-rw-r--r--src/nvim/undo.h4
-rw-r--r--src/nvim/usercmd.h29
-rw-r--r--src/nvim/window.h53
58 files changed, 299 insertions, 295 deletions
diff --git a/src/clint.py b/src/clint.py
index c6d7d1e8a3..c9e6ca9973 100755
--- a/src/clint.py
+++ b/src/clint.py
@@ -897,20 +897,12 @@ def CheckIncludes(filename, lines, error):
# These should be synced with the ignored headers in the `iwyu` target in
# the Makefile.
check_includes_ignore = [
- "src/nvim/api/buffer.h",
- "src/nvim/api/command.h",
"src/nvim/api/extmark.h",
- "src/nvim/api/options.h",
"src/nvim/api/private/defs.h",
"src/nvim/api/private/dispatch.h",
"src/nvim/api/private/helpers.h",
"src/nvim/api/private/validate.h",
"src/nvim/api/ui.h",
- "src/nvim/api/vim.h",
- "src/nvim/api/vimscript.h",
- "src/nvim/api/win_config.h",
- "src/nvim/api/window.h",
- "src/nvim/arglist.h",
"src/nvim/ascii.h",
"src/nvim/assert.h",
"src/nvim/autocmd.h",
@@ -918,28 +910,19 @@ def CheckIncludes(filename, lines, error):
"src/nvim/buffer.h",
"src/nvim/buffer_defs.h",
"src/nvim/buffer_updates.h",
- "src/nvim/bufwrite.h",
- "src/nvim/change.h",
"src/nvim/channel.h",
"src/nvim/charset.h",
"src/nvim/cmdexpand.h",
- "src/nvim/cmdexpand_defs.h",
"src/nvim/cmdhist.h",
"src/nvim/context.h",
- "src/nvim/cursor.h",
"src/nvim/decoration.h",
"src/nvim/decoration_defs.h",
"src/nvim/decoration_provider.h",
"src/nvim/diff.h",
- "src/nvim/digraph.h",
"src/nvim/drawline.h",
"src/nvim/drawscreen.h",
- "src/nvim/edit.h",
"src/nvim/eval.h",
- "src/nvim/eval/buffer.h",
- "src/nvim/eval/decode.h",
"src/nvim/eval/encode.h",
- "src/nvim/eval/funcs.h",
"src/nvim/eval/typval.h",
"src/nvim/eval/typval_defs.h",
"src/nvim/eval/typval_encode.h",
@@ -959,46 +942,34 @@ def CheckIncludes(filename, lines, error):
"src/nvim/ex_cmds.h",
"src/nvim/ex_cmds_defs.h",
"src/nvim/ex_docmd.h",
- "src/nvim/ex_eval_defs.h",
"src/nvim/ex_getln.h",
"src/nvim/extmark.h",
"src/nvim/extmark_defs.h",
"src/nvim/file_search.h",
"src/nvim/fileio.h",
"src/nvim/fold.h",
- "src/nvim/fold_defs.h",
"src/nvim/garray.h",
"src/nvim/getchar.h",
"src/nvim/globals.h",
"src/nvim/grid.h",
- "src/nvim/grid_defs.h",
- "src/nvim/hashtab.h",
"src/nvim/highlight.h",
"src/nvim/highlight_defs.h",
"src/nvim/highlight_group.h",
- "src/nvim/indent.h",
- "src/nvim/indent_c.h",
"src/nvim/input.h",
"src/nvim/insexpand.h",
"src/nvim/keycodes.h",
- "src/nvim/linematch.h",
"src/nvim/log.h",
"src/nvim/lua/executor.h",
"src/nvim/macros.h",
"src/nvim/main.h",
"src/nvim/map.h",
- "src/nvim/mapping.h",
- "src/nvim/mapping_defs.h",
"src/nvim/mark.h",
"src/nvim/mark_defs.h",
"src/nvim/marktree.h",
- "src/nvim/match.h",
"src/nvim/mbyte.h",
"src/nvim/mbyte_defs.h",
"src/nvim/memfile_defs.h",
- "src/nvim/memline.h",
"src/nvim/memory.h",
- "src/nvim/menu.h",
"src/nvim/message.h",
"src/nvim/mouse.h",
"src/nvim/move.h",
@@ -1009,31 +980,22 @@ def CheckIncludes(filename, lines, error):
"src/nvim/normal.h",
"src/nvim/ops.h",
"src/nvim/option.h",
- "src/nvim/option_defs.h",
"src/nvim/option_vars.h",
"src/nvim/os/fileio.h",
- "src/nvim/os/fs.h",
"src/nvim/os/input.h",
- "src/nvim/os/lang.h",
"src/nvim/os/pty_conpty_win.h",
"src/nvim/os/pty_process_unix.h",
"src/nvim/os/pty_process_win.h",
"src/nvim/path.h",
"src/nvim/plines.h",
"src/nvim/popupmenu.h",
- "src/nvim/profile.h",
- "src/nvim/quickfix.h",
- "src/nvim/regexp.h",
- "src/nvim/regexp_defs.h",
"src/nvim/search.h",
- "src/nvim/sign.h",
"src/nvim/spell.h",
"src/nvim/spell_defs.h",
"src/nvim/statusline.h",
"src/nvim/statusline_defs.h",
"src/nvim/strings.h",
"src/nvim/syntax.h",
- "src/nvim/testing.h",
"src/nvim/textformat.h",
"src/nvim/textobject.h",
"src/nvim/tui/input.h",
@@ -1042,8 +1004,6 @@ def CheckIncludes(filename, lines, error):
"src/nvim/ui.h",
"src/nvim/ui_client.h",
"src/nvim/ui_compositor.h",
- "src/nvim/undo.h",
- "src/nvim/usercmd.h",
"src/nvim/version.h",
"src/nvim/vim.h",
"src/nvim/viml/parser/expressions.h",
diff --git a/src/nvim/api/buffer.h b/src/nvim/api/buffer.h
index 557cf8db0c..f3971c1d30 100644
--- a/src/nvim/api/buffer.h
+++ b/src/nvim/api/buffer.h
@@ -3,9 +3,9 @@
#include <lua.h> // IWYU pragma: keep
#include <stdint.h> // IWYU pragma: keep
-#include "nvim/api/keysets_defs.h"
+#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
#include "nvim/api/private/defs.h" // IWYU pragma: keep
-#include "nvim/buffer_defs.h"
+#include "nvim/buffer_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "api/buffer.h.generated.h"
diff --git a/src/nvim/api/command.h b/src/nvim/api/command.h
index 95f0e05993..1cccbfb4c7 100644
--- a/src/nvim/api/command.h
+++ b/src/nvim/api/command.h
@@ -2,7 +2,7 @@
#include <stdint.h> // IWYU pragma: keep
-#include "nvim/api/keysets_defs.h"
+#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
#include "nvim/api/private/defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/api/extmark.h b/src/nvim/api/extmark.h
index 2989dee53d..491e468d95 100644
--- a/src/nvim/api/extmark.h
+++ b/src/nvim/api/extmark.h
@@ -2,7 +2,7 @@
#include <stdint.h> // IWYU pragma: keep
-#include "nvim/api/keysets_defs.h"
+#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
#include "nvim/api/private/defs.h" // IWYU pragma: keep
#include "nvim/decoration_defs.h" // IWYU pragma: keep
#include "nvim/macros.h"
diff --git a/src/nvim/api/options.h b/src/nvim/api/options.h
index e44ed44c80..c16c6088b3 100644
--- a/src/nvim/api/options.h
+++ b/src/nvim/api/options.h
@@ -2,7 +2,7 @@
#include <stdint.h> // IWYU pragma: keep
-#include "nvim/api/keysets_defs.h"
+#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
#include "nvim/api/private/defs.h" // IWYU pragma: keep
#include "nvim/option_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/api/private/dispatch.h b/src/nvim/api/private/dispatch.h
index 3d12b941f4..6a2c9eaf54 100644
--- a/src/nvim/api/private/dispatch.h
+++ b/src/nvim/api/private/dispatch.h
@@ -4,7 +4,7 @@
#include <stdint.h>
#include "nvim/api/private/defs.h"
-#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/types_defs.h"
typedef Object (*ApiDispatchWrapper)(uint64_t channel_id, Array args, Arena *arena, Error *error);
diff --git a/src/nvim/api/vim.h b/src/nvim/api/vim.h
index b2ebacb309..b620158751 100644
--- a/src/nvim/api/vim.h
+++ b/src/nvim/api/vim.h
@@ -2,7 +2,7 @@
#include <stdint.h> // IWYU pragma: keep
-#include "nvim/api/keysets_defs.h"
+#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
#include "nvim/api/private/defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/api/vimscript.h b/src/nvim/api/vimscript.h
index c068542311..c315e932e9 100644
--- a/src/nvim/api/vimscript.h
+++ b/src/nvim/api/vimscript.h
@@ -2,7 +2,7 @@
#include <stdint.h> // IWYU pragma: keep
-#include "nvim/api/keysets_defs.h"
+#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
#include "nvim/api/private/defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/api/win_config.h b/src/nvim/api/win_config.h
index 47e441a592..6df8ed13fa 100644
--- a/src/nvim/api/win_config.h
+++ b/src/nvim/api/win_config.h
@@ -2,7 +2,7 @@
#include <stdint.h> // IWYU pragma: keep
-#include "nvim/api/keysets_defs.h"
+#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
#include "nvim/api/private/defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/api/window.h b/src/nvim/api/window.h
index 600d6956b5..a5c9f86225 100644
--- a/src/nvim/api/window.h
+++ b/src/nvim/api/window.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/api/keysets_defs.h"
+#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
#include "nvim/api/private/defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/arglist.h b/src/nvim/arglist.h
index bcb5c8f565..97729f466c 100644
--- a/src/nvim/arglist.h
+++ b/src/nvim/arglist.h
@@ -4,7 +4,7 @@
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
-#include "nvim/types_defs.h"
+#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "arglist.h.generated.h"
diff --git a/src/nvim/bufwrite.h b/src/nvim/bufwrite.h
index 38d4d7745e..9ed6216847 100644
--- a/src/nvim/bufwrite.h
+++ b/src/nvim/bufwrite.h
@@ -2,7 +2,7 @@
#include "nvim/buffer_defs.h" // IWYU pragma: keep
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
-#include "nvim/pos_defs.h"
+#include "nvim/pos_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "bufwrite.h.generated.h"
diff --git a/src/nvim/change.h b/src/nvim/change.h
index 1c90b67fe3..06155b6da6 100644
--- a/src/nvim/change.h
+++ b/src/nvim/change.h
@@ -1,15 +1,17 @@
#pragma once
#include "nvim/buffer_defs.h" // IWYU pragma: keep
-#include "nvim/pos_defs.h"
+#include "nvim/pos_defs.h" // IWYU pragma: keep
-// flags for open_line()
-#define OPENLINE_DELSPACES 0x01 // delete spaces after cursor
-#define OPENLINE_DO_COM 0x02 // format comments
-#define OPENLINE_KEEPTRAIL 0x04 // keep trailing spaces
-#define OPENLINE_MARKFIX 0x08 // fix mark positions
-#define OPENLINE_COM_LIST 0x10 // format comments with list/2nd line indent
-#define OPENLINE_FORMAT 0x20 // formatting long comment
+/// flags for open_line()
+enum {
+ OPENLINE_DELSPACES = 0x01, ///< delete spaces after cursor
+ OPENLINE_DO_COM = 0x02, ///< format comments
+ OPENLINE_KEEPTRAIL = 0x04, ///< keep trailing spaces
+ OPENLINE_MARKFIX = 0x08, ///< fix mark positions
+ OPENLINE_COM_LIST = 0x10, ///< format comments with list/2nd line indent
+ OPENLINE_FORMAT = 0x20, ///< formatting long comment
+};
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "change.h.generated.h"
diff --git a/src/nvim/cmdexpand.h b/src/nvim/cmdexpand.h
index 4ae702f18d..b0772d26a3 100644
--- a/src/nvim/cmdexpand.h
+++ b/src/nvim/cmdexpand.h
@@ -4,7 +4,7 @@
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/ex_getln.h"
#include "nvim/garray_defs.h" // IWYU pragma: keep
-#include "nvim/types_defs.h"
+#include "nvim/types_defs.h" // IWYU pragma: keep
// Values for nextwild() and ExpandOne(). See ExpandOne() for meaning.
diff --git a/src/nvim/cursor.h b/src/nvim/cursor.h
index ea63f7c1e5..d50976b598 100644
--- a/src/nvim/cursor.h
+++ b/src/nvim/cursor.h
@@ -1,7 +1,7 @@
#pragma once
#include "nvim/buffer_defs.h" // IWYU pragma: keep
-#include "nvim/pos_defs.h"
+#include "nvim/pos_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "cursor.h.generated.h"
diff --git a/src/nvim/digraph.h b/src/nvim/digraph.h
index 792e859991..267004124b 100644
--- a/src/nvim/digraph.h
+++ b/src/nvim/digraph.h
@@ -4,7 +4,7 @@
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/garray_defs.h" // IWYU pragma: keep
-#include "nvim/types_defs.h"
+#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "digraph.h.generated.h"
diff --git a/src/nvim/edit.h b/src/nvim/edit.h
index 7cf4141045..434b653f7b 100644
--- a/src/nvim/edit.h
+++ b/src/nvim/edit.h
@@ -2,29 +2,37 @@
#include "nvim/autocmd_defs.h" // IWYU pragma: keep
#include "nvim/buffer_defs.h" // IWYU pragma: keep
-#include "nvim/pos_defs.h"
+#include "nvim/pos_defs.h" // IWYU pragma: keep
-// Values for in_cinkeys()
-#define KEY_OPEN_FORW 0x101
-#define KEY_OPEN_BACK 0x102
-#define KEY_COMPLETE 0x103 // end of completion
+/// Values for in_cinkeys()
+enum {
+ KEY_OPEN_FORW = 0x101,
+ KEY_OPEN_BACK = 0x102,
+ KEY_COMPLETE = 0x103, ///< end of completion
+};
-// Values for change_indent()
-#define INDENT_SET 1 // set indent
-#define INDENT_INC 2 // increase indent
-#define INDENT_DEC 3 // decrease indent
+/// Values for change_indent()
+enum {
+ INDENT_SET = 1, ///< set indent
+ INDENT_INC = 2, ///< increase indent
+ INDENT_DEC = 3, ///< decrease indent
+};
-// flags for beginline()
-#define BL_WHITE 1 // cursor on first non-white in the line
-#define BL_SOL 2 // use 'sol' option
-#define BL_FIX 4 // don't leave cursor on a NUL
+/// flags for beginline()
+enum {
+ BL_WHITE = 1, ///< cursor on first non-white in the line
+ BL_SOL = 2, ///< use 'sol' option
+ BL_FIX = 4, ///< don't leave cursor on a NUL
+};
-// flags for insertchar()
-#define INSCHAR_FORMAT 1 // force formatting
-#define INSCHAR_DO_COM 2 // format comments
-#define INSCHAR_CTRLV 4 // char typed just after CTRL-V
-#define INSCHAR_NO_FEX 8 // don't use 'formatexpr'
-#define INSCHAR_COM_LIST 16 // format comments with list/2nd line indent
+/// flags for insertchar()
+enum {
+ INSCHAR_FORMAT = 1, ///< force formatting
+ INSCHAR_DO_COM = 2, ///< format comments
+ INSCHAR_CTRLV = 4, ///< char typed just after CTRL-V
+ INSCHAR_NO_FEX = 8, ///< don't use 'formatexpr'
+ INSCHAR_COM_LIST = 16, ///< format comments with list/2nd line indent
+};
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "edit.h.generated.h"
diff --git a/src/nvim/eval/buffer.h b/src/nvim/eval/buffer.h
index 106a499bad..1d346b99a5 100644
--- a/src/nvim/eval/buffer.h
+++ b/src/nvim/eval/buffer.h
@@ -2,7 +2,7 @@
#include "nvim/buffer_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
-#include "nvim/types_defs.h"
+#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "eval/buffer.h.generated.h"
diff --git a/src/nvim/eval/decode.h b/src/nvim/eval/decode.h
index 1c0fd445f1..c0d10a469a 100644
--- a/src/nvim/eval/decode.h
+++ b/src/nvim/eval/decode.h
@@ -4,7 +4,7 @@
#include <stddef.h> // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
-#include "nvim/types_defs.h"
+#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "eval/decode.h.generated.h"
diff --git a/src/nvim/eval/funcs.h b/src/nvim/eval/funcs.h
index 09f709be06..0c345dacb4 100644
--- a/src/nvim/eval/funcs.h
+++ b/src/nvim/eval/funcs.h
@@ -3,18 +3,20 @@
#include <stdbool.h>
#include <stdint.h>
-#include "nvim/api/private/dispatch.h"
-#include "nvim/buffer_defs.h"
-#include "nvim/cmdexpand_defs.h"
+#include "nvim/buffer_defs.h" // IWYU pragma: keep
+#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h"
+#include "nvim/pos_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h"
/// Prototype of C function that implements Vimscript function
typedef void (*VimLFunc)(typval_T *args, typval_T *rvar, EvalFuncData data);
/// Special flags for base_arg @see EvalFuncDef
-#define BASE_NONE 0 ///< Not a method (no base argument).
-#define BASE_LAST UINT8_MAX ///< Use the last argument as the method base.
+enum {
+ BASE_NONE = 0, ///< Not a method (no base argument).
+ BASE_LAST = UINT8_MAX, ///< Use the last argument as the method base.
+};
/// Structure holding Vimscript function definition
typedef struct {
diff --git a/src/nvim/eval/vars.h b/src/nvim/eval/vars.h
index 849d0c4229..3512152184 100644
--- a/src/nvim/eval/vars.h
+++ b/src/nvim/eval/vars.h
@@ -6,7 +6,7 @@
#include "nvim/garray_defs.h" // IWYU pragma: keep
#include "nvim/hashtab.h"
#include "nvim/option_defs.h" // IWYU pragma: keep
-#include "nvim/types_defs.h"
+#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "eval/vars.h.generated.h"
diff --git a/src/nvim/ex_cmds.h b/src/nvim/ex_cmds.h
index 529009415b..de13f03197 100644
--- a/src/nvim/ex_cmds.h
+++ b/src/nvim/ex_cmds.h
@@ -6,7 +6,7 @@
#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds_defs.h" // IWYU pragma: export
#include "nvim/os/time.h"
-#include "nvim/pos_defs.h"
+#include "nvim/pos_defs.h" // IWYU pragma: keep
// flags for do_ecmd()
#define ECMD_HIDE 0x01 // don't free the current buffer
diff --git a/src/nvim/ex_docmd.h b/src/nvim/ex_docmd.h
index 1ccd112e2a..3781ba1a34 100644
--- a/src/nvim/ex_docmd.h
+++ b/src/nvim/ex_docmd.h
@@ -2,29 +2,34 @@
#include <stdbool.h>
-#include "nvim/buffer_defs.h"
-#include "nvim/cmdexpand_defs.h"
-#include "nvim/ex_cmds_defs.h"
+#include "nvim/buffer_defs.h" // IWYU pragma: keep
+#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
+#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/getchar_defs.h"
#include "nvim/globals.h"
+#include "nvim/types_defs.h" // IWYU pragma: keep
-// flags for do_cmdline()
-#define DOCMD_VERBOSE 0x01 // included command in error message
-#define DOCMD_NOWAIT 0x02 // don't call wait_return() and friends
-#define DOCMD_REPEAT 0x04 // repeat exec. until getline() returns NULL
-#define DOCMD_KEYTYPED 0x08 // don't reset KeyTyped
-#define DOCMD_EXCRESET 0x10 // reset exception environment (for debugging
-#define DOCMD_KEEPLINE 0x20 // keep typed line for repeating with "."
+/// flags for do_cmdline()
+enum {
+ DOCMD_VERBOSE = 0x01, ///< included command in error message
+ DOCMD_NOWAIT = 0x02, ///< don't call wait_return() and friends
+ DOCMD_REPEAT = 0x04, ///< repeat exec. until getline() returns NULL
+ DOCMD_KEYTYPED = 0x08, ///< don't reset KeyTyped
+ DOCMD_EXCRESET = 0x10, ///< reset exception environment (for debugging
+ DOCMD_KEEPLINE = 0x20, ///< keep typed line for repeating with "."
+};
-// defines for eval_vars()
-#define VALID_PATH 1
-#define VALID_HEAD 2
+/// defines for eval_vars()
+enum {
+ VALID_PATH = 1,
+ VALID_HEAD = 2,
+};
// Whether a command index indicates a user command.
#define IS_USER_CMDIDX(idx) ((int)(idx) < 0)
-// Structure used to save the current state. Used when executing Normal mode
-// commands while in any other mode.
+/// Structure used to save the current state. Used when executing Normal mode
+/// commands while in any