aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/clint.py12
-rw-r--r--src/nvim/api/autocmd.c3
-rw-r--r--src/nvim/api/buffer.c7
-rw-r--r--src/nvim/api/command.c4
-rw-r--r--src/nvim/api/deprecated.c4
-rw-r--r--src/nvim/api/extmark.c1
-rw-r--r--src/nvim/api/options.c4
-rw-r--r--src/nvim/api/private/converter.h2
-rw-r--r--src/nvim/api/private/dispatch.h2
-rw-r--r--src/nvim/api/private/helpers.c4
-rw-r--r--src/nvim/api/private/helpers.h2
-rw-r--r--src/nvim/api/private/validate.h2
-rw-r--r--src/nvim/api/ui.c6
-rw-r--r--src/nvim/api/vim.c15
-rw-r--r--src/nvim/api/vimscript.c3
-rw-r--r--src/nvim/api/win_config.c5
-rw-r--r--src/nvim/api/window.c4
-rw-r--r--src/nvim/arglist.c6
-rw-r--r--src/nvim/arglist.h2
-rw-r--r--src/nvim/ascii_defs.h1
-rw-r--r--src/nvim/autocmd.c9
-rw-r--r--src/nvim/autocmd.h2
-rw-r--r--src/nvim/autocmd_defs.h5
-rw-r--r--src/nvim/buffer.c62
-rw-r--r--src/nvim/buffer.h61
-rw-r--r--src/nvim/buffer_defs.h13
-rw-r--r--src/nvim/buffer_updates.c1
-rw-r--r--src/nvim/bufwrite.c8
-rw-r--r--src/nvim/change.c10
-rw-r--r--src/nvim/channel.c6
-rw-r--r--src/nvim/channel.h4
-rw-r--r--src/nvim/channel_defs.h6
-rw-r--r--src/nvim/charset.c1
-rw-r--r--src/nvim/cmdexpand.c11
-rw-r--r--src/nvim/cmdexpand.h2
-rw-r--r--src/nvim/cmdexpand_defs.h1
-rw-r--r--src/nvim/cmdhist.c3
-rw-r--r--src/nvim/context.c2
-rw-r--r--src/nvim/cursor.c1
-rw-r--r--src/nvim/cursor_shape.c2
-rw-r--r--src/nvim/debugger.c7
-rw-r--r--src/nvim/decoration.c2
-rw-r--r--src/nvim/decoration.h2
-rw-r--r--src/nvim/decoration_provider.c1
-rw-r--r--src/nvim/diff.c9
-rw-r--r--src/nvim/digraph.c4
-rw-r--r--src/nvim/drawline.c19
-rw-r--r--src/nvim/drawscreen.c103
-rw-r--r--src/nvim/edit.c10
-rw-r--r--src/nvim/eval.c13
-rw-r--r--src/nvim/eval.h2
-rw-r--r--src/nvim/eval/buffer.c1
-rw-r--r--src/nvim/eval/decode.c3
-rw-r--r--src/nvim/eval/encode.c16
-rw-r--r--src/nvim/eval/encode.h19
-rw-r--r--src/nvim/eval/executor.c2
-rw-r--r--src/nvim/eval/funcs.c24
-rw-r--r--src/nvim/eval/typval.c6
-rw-r--r--src/nvim/eval/typval.h6
-rw-r--r--src/nvim/eval/typval_defs.h3
-rw-r--r--src/nvim/eval/userfunc.c8
-rw-r--r--src/nvim/eval/vars.c5
-rw-r--r--src/nvim/eval/window.c5
-rw-r--r--src/nvim/eval/window.h2
-rw-r--r--src/nvim/event/defs.h30
-rw-r--r--src/nvim/event/libuv_process.c11
-rw-r--r--src/nvim/event/libuv_process.h11
-rw-r--r--src/nvim/event/loop.h2
-rw-r--r--src/nvim/event/multiqueue.c2
-rw-r--r--src/nvim/event/multiqueue.h2
-rw-r--r--src/nvim/event/process.c2
-rw-r--r--src/nvim/event/process.h32
-rw-r--r--src/nvim/event/rstream.c1
-rw-r--r--src/nvim/event/rstream.h2
-rw-r--r--src/nvim/event/signal.h2
-rw-r--r--src/nvim/event/socket.c4
-rw-r--r--src/nvim/event/socket.h2
-rw-r--r--src/nvim/event/stream.h2
-rw-r--r--src/nvim/event/time.h2
-rw-r--r--src/nvim/event/wstream.h2
-rw-r--r--src/nvim/ex_cmds.c14
-rw-r--r--src/nvim/ex_cmds.h2
-rw-r--r--src/nvim/ex_cmds2.c6
-rw-r--r--src/nvim/ex_cmds_defs.h2
-rw-r--r--src/nvim/ex_docmd.c18
-rw-r--r--src/nvim/ex_eval.c6
-rw-r--r--src/nvim/ex_eval.h2
-rw-r--r--src/nvim/ex_getln.c15
-rw-r--r--src/nvim/ex_getln.h2
-rw-r--r--src/nvim/ex_session.c8
-rw-r--r--src/nvim/extmark.c2
-rw-r--r--src/nvim/extmark.h2
-rw-r--r--src/nvim/extmark_defs.h1
-rw-r--r--src/nvim/file_search.c6
-rw-r--r--src/nvim/file_search.h2
-rw-r--r--src/nvim/fileio.c11
-rw-r--r--src/nvim/fold.c5
-rw-r--r--src/nvim/fold.h2
-rw-r--r--src/nvim/garray.c9
-rw-r--r--src/nvim/garray.h12
-rw-r--r--src/nvim/getchar.c9
-rw-r--r--src/nvim/getchar.h2
-rw-r--r--src/nvim/gettext_defs.h (renamed from src/nvim/gettext.h)0
-rw-r--r--src/nvim/grid.c233
-rw-r--r--src/nvim/grid.h15
-rw-r--r--src/nvim/hashtab.c2
-rw-r--r--src/nvim/hashtab.h2
-rw-r--r--src/nvim/help.c8
-rw-r--r--src/nvim/highlight.c3
-rw-r--r--src/nvim/highlight.h4
-rw-r--r--src/nvim/highlight_group.c13
-rw-r--r--src/nvim/indent.c8
-rw-r--r--src/nvim/indent_c.c2
-rw-r--r--src/nvim/input.c3
-rw-r--r--src/nvim/insexpand.c14
-rw-r--r--src/nvim/keycodes.c4
-rw-r--r--src/nvim/keycodes.h2
-rw-r--r--src/nvim/lib/queue_defs.h (renamed from src/nvim/lib/queue.h)0
-rw-r--r--src/nvim/log.c1
-rw-r--r--src/nvim/lua/converter.c2
-rw-r--r--src/nvim/lua/executor.c14
-rw-r--r--src/nvim/lua/executor.h1
-rw-r--r--src/nvim/lua/secure.c2
-rw-r--r--src/nvim/lua/spell.c2
-rw-r--r--src/nvim/lua/stdlib.c4
-rw-r--r--src/nvim/lua/xdiff.c1
-rw-r--r--src/nvim/main.c16
-rw-r--r--src/nvim/map_glyph_cache.c1
-rw-r--r--src/nvim/mapping.c7
-rw-r--r--src/nvim/mapping.h2
-rw-r--r--src/nvim/mapping_defs.h1
-rw-r--r--src/nvim/mark.c9
-rw-r--r--src/nvim/mark.h2
-rw-r--r--src/nvim/mark_defs.h1
-rw-r--r--src/nvim/marktree.c1
-rw-r--r--src/nvim/marktree.h2
-rw-r--r--src/nvim/marktree_defs.h1
-rw-r--r--src/nvim/match.c4
-rw-r--r--src/nvim/mbyte.c14
-rw-r--r--src/nvim/mbyte.h17
-rw-r--r--src/nvim/memfile.c5
-rw-r--r--src/nvim/memfile.h2
-rw-r--r--src/nvim/memfile_defs.h2
-rw-r--r--src/nvim/memline.c10
-rw-r--r--src/nvim/memline.h2
-rw-r--r--src/nvim/memline_defs.h1
-rw-r--r--src/nvim/memory.c3
-rw-r--r--src/nvim/memory.h4
-rw-r--r--src/nvim/menu.c9
-rw-r--r--src/nvim/menu.h2
-rw-r--r--src/nvim/message.c13
-rw-r--r--src/nvim/message.h3
-rw-r--r--src/nvim/message_defs.h3
-rw-r--r--src/nvim/mouse.c6
-rw-r--r--src/nvim/move.c6
-rw-r--r--src/nvim/msgpack_rpc/channel.c2
-rw-r--r--src/nvim/msgpack_rpc/channel.h2
-rw-r--r--src/nvim/msgpack_rpc/channel_defs.h4
-rw-r--r--src/nvim/msgpack_rpc/server.c2
-rw-r--r--src/nvim/msgpack_rpc/unpacker.h3
-rw-r--r--src/nvim/normal.c10
-rw-r--r--src/nvim/normal.h2
-rw-r--r--src/nvim/ops.c11
-rw-r--r--src/nvim/option.c33
-rw-r--r--src/nvim/option.h26
-rw-r--r--src/nvim/option_defs.h1
-rw-r--r--src/nvim/option_vars.h1
-rw-r--r--src/nvim/optionstr.c3
-rw-r--r--src/nvim/os/dl.c2
-rw-r--r--src/nvim/os/env.c4
-rw-r--r--src/nvim/os/fileio.c3
-rw-r--r--src/nvim/os/fileio.h2
-rw-r--r--src/nvim/os/fs.c3
-rw-r--r--src/nvim/os/fs.h2
-rw-r--r--src/nvim/os/input.c5
-rw-r--r--src/nvim/os/lang.c2
-rw-r--r--src/nvim/os/os.h16
-rw-r--r--src/nvim/os/pty_process_unix.c12
-rw-r--r--src/nvim/os/pty_process_unix.h13
-rw-r--r--src/nvim/os/pty_process_win.c12
-rw-r--r--src/nvim/os/pty_process_win.h14
-rw-r--r--src/nvim/os/shell.c4
-rw-r--r--src/nvim/os/signal.c2
-rw-r--r--src/nvim/os/time.c2
-rw-r--r--src/nvim/os/time.h2
-rw-r--r--src/nvim/os/users.c2
-rw-r--r--src/nvim/path.c6
-rw-r--r--src/nvim/plines.c4
-rw-r--r--src/nvim/popupmenu.c9
-rw-r--r--src/nvim/profile.c3
-rw-r--r--src/nvim/quickfix.c11
-rw-r--r--src/nvim/rbuffer.h2
-rw-r--r--src/nvim/regexp.c141
-rw-r--r--src/nvim/regexp.h2
-rw-r--r--src/nvim/runtime.c8
-rw-r--r--src/nvim/runtime.h2
-rw-r--r--src/nvim/runtime_defs.h5
-rw-r--r--src/nvim/search.c9
-rw-r--r--src/nvim/shada.c15
-rw-r--r--src/nvim/sign.c9
-rw-r--r--src/nvim/sign.h2
-rw-r--r--src/nvim/spell.c11
-rw-r--r--src/nvim/spell.h4
-rw-r--r--src/nvim/spell_defs.h3
-rw-r--r--src/nvim/spellfile.c10
-rw-r--r--src/nvim/spellsuggest.c7
-rw-r--r--src/nvim/state.c3
-rw-r--r--src/nvim/state.h2
-rw-r--r--src/nvim/statusline.c11
-rw-r--r--src/nvim/statusline.h2
-rw-r--r--src/nvim/strings.c4
-rw-r--r--src/nvim/syntax.c8
-rw-r--r--src/nvim/syntax.h2
-rw-r--r--src/nvim/syntax_defs.h3
-rw-r--r--src/nvim/tag.c11
-rw-r--r--src/nvim/terminal.c10
-rw-r--r--src/nvim/testing.c5
-rw-r--r--src/nvim/textformat.c1
-rw-r--r--src/nvim/textobject.c1
-rw-r--r--src/nvim/tui/input.c2
-rw-r--r--src/nvim/tui/input.h6
-rw-r--r--src/nvim/tui/tui.c3
-rw-r--r--src/nvim/tui/tui.h17
-rw-r--r--src/nvim/tui/tui_defs.h15
-rw-r--r--src/nvim/types_defs.h1
-rw-r--r--src/nvim/ui.c12
-rw-r--r--src/nvim/ui.h2
-rw-r--r--src/nvim/ui_client.c7
-rw-r--r--src/nvim/ui_client.h7
-rw-r--r--src/nvim/ui_compositor.c1
-rw-r--r--src/nvim/ui_defs.h5
-rw-r--r--src/nvim/undo.c10
-rw-r--r--src/nvim/undo.h2
-rw-r--r--src/nvim/undo_defs.h1
-rw-r--r--src/nvim/usercmd.c3
-rw-r--r--src/nvim/usercmd.h2
-rw-r--r--src/nvim/version.c4
-rw-r--r--src/nvim/vim_defs.h3
-rw-r--r--src/nvim/viml/parser/expressions.c2
-rw-r--r--src/nvim/viml/parser/expressions.h2
-rw-r--r--src/nvim/viml/parser/parser.c62
-rw-r--r--src/nvim/viml/parser/parser.h142
-rw-r--r--src/nvim/viml/parser/parser_defs.h79
-rw-r--r--src/nvim/window.c12
-rw-r--r--src/nvim/winfloat.c2
245 files changed, 1396 insertions, 843 deletions
diff --git a/src/clint.py b/src/clint.py
index 7fcf840487..78eabb698f 100755
--- a/src/clint.py
+++ b/src/clint.py
@@ -853,17 +853,12 @@ def CheckIncludes(filename, lines, error):
check_includes_ignore = [
"src/nvim/api/private/validate.h",
"src/nvim/assert_defs.h",
- "src/nvim/buffer.h",
"src/nvim/channel.h",
"src/nvim/charset.h",
- "src/nvim/eval/encode.h",
"src/nvim/eval/typval.h",
- "src/nvim/eval/typval_defs.h",
- "src/nvim/event/libuv_process.h",
"src/nvim/event/multiqueue.h",
"src/nvim/garray.h",
"src/nvim/globals.h",
- "src/nvim/grid.h",
"src/nvim/highlight.h",
"src/nvim/lua/executor.h",
"src/nvim/main.h",
@@ -872,18 +867,17 @@ def CheckIncludes(filename, lines, error):
"src/nvim/msgpack_rpc/unpacker.h",
"src/nvim/option.h",
"src/nvim/os/pty_conpty_win.h",
- "src/nvim/os/pty_process_unix.h",
"src/nvim/os/pty_process_win.h",
- "src/nvim/tui/input.h",
- "src/nvim/viml/parser/expressions.h",
- "src/nvim/viml/parser/parser.h",
]
skip_headers = [
"auto/config.h",
"klib/klist.h",
"klib/kvec.h",
+ "mpack/mpack_core.h",
+ "mpack/object.h",
"nvim/func_attr.h",
+ "termkey/termkey.h",
]
for i in check_includes_ignore:
diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c
index 88d7d985e8..78628c4154 100644
--- a/src/nvim/api/autocmd.c
+++ b/src/nvim/api/autocmd.c
@@ -14,8 +14,11 @@
#include "nvim/api/private/helpers.h"
#include "nvim/api/private/validate.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/globals.h"
#include "nvim/lua/executor.h"
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index c07e760469..8a091f39e4 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -17,25 +17,32 @@
#include "nvim/api/private/validate.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/buffer_updates.h"
#include "nvim/change.h"
#include "nvim/cursor.h"
#include "nvim/drawscreen.h"
#include "nvim/ex_cmds.h"
#include "nvim/extmark.h"
+#include "nvim/extmark_defs.h"
#include "nvim/globals.h"
#include "nvim/lua/executor.h"
#include "nvim/mapping.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/memline.h"
+#include "nvim/memline_defs.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/move.h"
#include "nvim/ops.h"
#include "nvim/pos_defs.h"
#include "nvim/state_defs.h"
#include "nvim/types_defs.h"
#include "nvim/undo.h"
+#include "nvim/undo_defs.h"
#include "nvim/vim_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/api/command.c b/src/nvim/api/command.c
index abb589ecdf..db0a918f5c 100644
--- a/src/nvim/api/command.c
+++ b/src/nvim/api/command.c
@@ -13,12 +13,14 @@
#include "nvim/api/private/validate.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/cmdexpand_defs.h"
-#include "nvim/ex_cmds.h"
+#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/globals.h"
#include "nvim/lua/executor.h"
#include "nvim/macros_defs.h"
diff --git a/src/nvim/api/deprecated.c b/src/nvim/api/deprecated.c
index f7bbd61cd3..b09645a819 100644
--- a/src/nvim/api/deprecated.c
+++ b/src/nvim/api/deprecated.c
@@ -6,20 +6,22 @@
#include "nvim/api/deprecated.h"
#include "nvim/api/extmark.h"
#include "nvim/api/keysets_defs.h"
-#include "nvim/api/options.h"
#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/api/private/validate.h"
#include "nvim/api/vimscript.h"
#include "nvim/buffer_defs.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/extmark.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
#include "nvim/highlight_group.h"
#include "nvim/lua/executor.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/pos_defs.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c
index e66e25e527..9dec4a6c70 100644
--- a/src/nvim/api/extmark.c
+++ b/src/nvim/api/extmark.c
@@ -20,6 +20,7 @@
#include "nvim/grid.h"
#include "nvim/highlight_group.h"
#include "nvim/marktree.h"
+#include "nvim/marktree_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c
index ff1741558d..fce4a85804 100644
--- a/src/nvim/api/options.c
+++ b/src/nvim/api/options.c
@@ -9,14 +9,14 @@
#include "nvim/api/private/helpers.h"
#include "nvim/api/private/validate.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/globals.h"
-#include "nvim/macros_defs.h"
#include "nvim/memory.h"
#include "nvim/option.h"
#include "nvim/types_defs.h"
#include "nvim/vim_defs.h"
-#include "nvim/window.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "api/options.c.generated.h"
diff --git a/src/nvim/api/private/converter.h b/src/nvim/api/private/converter.h
index a5acc56c7c..fc82abf332 100644
--- a/src/nvim/api/private/converter.h
+++ b/src/nvim/api/private/converter.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/api/private/defs.h" // IWYU pragma: export
+#include "nvim/api/private/defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/api/private/dispatch.h b/src/nvim/api/private/dispatch.h
index 9b167a7b9e..6d051176ac 100644
--- a/src/nvim/api/private/dispatch.h
+++ b/src/nvim/api/private/dispatch.h
@@ -3,7 +3,7 @@
#include <stdbool.h>
#include <stdint.h>
-#include "nvim/api/private/defs.h" // IWYU pragma: export
+#include "nvim/api/private/defs.h" // IWYU pragma: keep
#include "nvim/memory_defs.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c
index 06addbecb7..677e1ce9fd 100644
--- a/src/nvim/api/private/helpers.c
+++ b/src/nvim/api/private/helpers.c
@@ -19,7 +19,7 @@
#include "nvim/eval/typval.h"
#include "nvim/eval/vars.h"
#include "nvim/ex_eval.h"
-#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight_group.h"
#include "nvim/lua/executor.h"
@@ -27,11 +27,13 @@
#include "nvim/mark.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/message.h"
#include "nvim/msgpack_rpc/helpers.h"
#include "nvim/pos_defs.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/version.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h
index 1ee66f906b..8a56d1704f 100644
--- a/src/nvim/api/private/helpers.h
+++ b/src/nvim/api/private/helpers.h
@@ -4,7 +4,7 @@
#include <stddef.h>
#include "klib/kvec.h"
-#include "nvim/api/private/defs.h" // IWYU pragma: export
+#include "nvim/api/private/defs.h" // IWYU pragma: keep
#include "nvim/buffer_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/ex_eval_defs.h"
diff --git a/src/nvim/api/private/validate.h b/src/nvim/api/private/validate.h
index 692ea46176..2c1d1a241d 100644
--- a/src/nvim/api/private/validate.h
+++ b/src/nvim/api/private/validate.h
@@ -3,7 +3,7 @@
#include <stdbool.h>
#include <stddef.h>
-#include "nvim/api/private/defs.h" // IWYU pragma: export
+#include "nvim/api/private/defs.h" // IWYU pragma: keep
#include "nvim/api/private/helpers.h"
#include "nvim/assert_defs.h"
#include "nvim/macros_defs.h"
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c
index 271e58b851..b42c274411 100644
--- a/src/nvim/api/ui.c
+++ b/src/nvim/api/ui.c
@@ -13,20 +13,26 @@
#include "nvim/api/private/validate.h"
#include "nvim/api/ui.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/channel.h"
+#include "nvim/channel_defs.h"
#include "nvim/eval.h"
+#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/wstream.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/highlight.h"
#include "nvim/macros_defs.h"
#include "nvim/main.h"
#include "nvim/map_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/msgpack_rpc/channel.h"
+#include "nvim/msgpack_rpc/channel_defs.h"
#include "nvim/msgpack_rpc/helpers.h"
#include "nvim/option.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index f683789945..e5a5cc059f 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -21,20 +21,26 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/channel.h"
+#include "nvim/channel_defs.h"
#include "nvim/context.h"
#include "nvim/cursor.h"
#include "nvim/decoration.h"
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/fold.h"
#include "nvim/getchar.h"
+#include "nvim/getchar_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/keycodes.h"
#include "nvim/log.h"
@@ -42,15 +48,20 @@
#include "nvim/macros_defs.h"
#include "nvim/mapping.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/message.h"
+#include "nvim/message_defs.h"
#include "nvim/move.h"
#include "nvim/msgpack_rpc/channel.h"
+#include "nvim/msgpack_rpc/channel_defs.h"
#include "nvim/msgpack_rpc/unpacker.h"
#include "nvim/ops.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/input.h"
@@ -59,9 +70,11 @@
#include "nvim/popupmenu.h"
#include "nvim/pos_defs.h"
#include "nvim/runtime.h"
-#include "nvim/sign.h"
+#include "nvim/sign_defs.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/statusline.h"
+#include "nvim/statusline_defs.h"
#include "nvim/strings.h"
#include "nvim/terminal.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/api/vimscript.c b/src/nvim/api/vimscript.c
index 953bd80b0f..56541bb8b8 100644
--- a/src/nvim/api/vimscript.c
+++ b/src/nvim/api/vimscript.c
@@ -14,15 +14,18 @@
#include "nvim/buffer_defs.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/eval/userfunc.h"
#include "nvim/ex_docmd.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/globals.h"
#include "nvim/memory.h"
#include "nvim/runtime.h"
#include "nvim/vim_defs.h"
#include "nvim/viml/parser/expressions.h"
#include "nvim/viml/parser/parser.h"
+#include "nvim/viml/parser/parser_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "api/vimscript.c.generated.h"
diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c
index 64eda43689..ccbd341fd2 100644
--- a/src/nvim/api/win_config.c
+++ b/src/nvim/api/win_config.c
@@ -10,11 +10,13 @@
#include "nvim/api/win_config.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/drawscreen.h"
#include "nvim/globals.h"
-#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
@@ -25,6 +27,7 @@
#include "nvim/syntax.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/window.h"
#include "nvim/winfloat.h"
diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c
index 7321d52e17..00126c64f1 100644
--- a/src/nvim/api/window.c
+++ b/src/nvim/api/window.c
@@ -15,10 +15,10 @@
#include "nvim/drawscreen.h"
#include "nvim/eval/window.h"
#include "nvim/ex_docmd.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/lua/executor.h"
-#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/message.h"
#include "nvim/move.h"
#include "nvim/plines.h"
diff --git a/src/nvim/arglist.c b/src/nvim/arglist.c
index 46725bbfc2..921d56ed78 100644
--- a/src/nvim/arglist.c
+++ b/src/nvim/arglist.c
@@ -10,9 +10,11 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand_defs.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/eval/window.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h"
@@ -20,7 +22,8 @@
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/macros_defs.h"
#include "nvim/mark.h"
@@ -33,6 +36,7 @@
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/types_defs.h"
#include "nvim/undo.h"
#include "nvim/version.h"
diff --git a/src/nvim/arglist.h b/src/nvim/arglist.h
index d117f6163b..5b49423c18 100644
--- a/src/nvim/arglist.h
+++ b/src/nvim/arglist.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/arglist_defs.h" // IWYU pragma: export
+#include "nvim/arglist_defs.h" // IWYU pragma: keep
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/ascii_defs.h b/src/nvim/ascii_defs.h
index 4215157654..0cd7ccfec4 100644
--- a/src/nvim/ascii_defs.h
+++ b/src/nvim/ascii_defs.h
@@ -3,7 +3,6 @@
#include <stdbool.h>
#include "nvim/func_attr.h"
-#include "nvim/macros_defs.h"
#include "nvim/os/os_defs.h"
// Definitions of various common control characters.
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index 7c64c717e8..b44158c890 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -25,11 +25,13 @@
#include "nvim/ex_eval.h"
#include "nvim/fileio.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/getchar_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/hashtab.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/insexpand.h"
#include "nvim/lua/executor.h"
#include "nvim/main.h"
@@ -37,17 +39,22 @@
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/time.h"
+#include "nvim/os/time_defs.h"
#include "nvim/path.h"
#include "nvim/profile.h"
#include "nvim/regexp.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/search.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
diff --git a/src/nvim/autocmd.h b/src/nvim/autocmd.h
index 50417c959b..8019cb7145 100644
--- a/src/nvim/autocmd.h
+++ b/src/nvim/autocmd.h
@@ -6,7 +6,7 @@
#include "klib/kvec.h"
#include "nvim/api/private/defs.h" // IWYU pragma: keep
-#include "nvim/autocmd_defs.h" // IWYU pragma: export
+#include "nvim/autocmd_defs.h" // IWYU pragma: keep
#include "nvim/buffer_defs.h"
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/autocmd_defs.h b/src/nvim/autocmd_defs.h
index ec81c2f1ed..d1f1e16e1a 100644
--- a/src/nvim/autocmd_defs.h
+++ b/src/nvim/autocmd_defs.h
@@ -4,13 +4,8 @@
#include <stddef.h>
#include <stdint.h>
-#include "klib/kvec.h"
-#include "nvim/api/private/defs.h"
#include "nvim/buffer_defs.h"
-#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds_defs.h"
-#include "nvim/regexp_defs.h"
-#include "nvim/types_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "auevents_enum.generated.h"
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index c22aaec3df..b29e87e91b 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -32,6 +32,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/assert_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
#include "nvim/buffer_updates.h"
#include "nvim/change.h"
@@ -43,21 +44,26 @@
#include "nvim/digraph.h"
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
+#include "nvim/eval/typval.h"
#include "nvim/eval/vars.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h"
+#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
+#include "nvim/ex_eval_defs.h"
#include "nvim/ex_getln.h"
#include "nvim/extmark.h"
#include "nvim/file_search.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
+#include "nvim/hashtab_defs.h"
#include "nvim/help.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
@@ -65,25 +71,33 @@
#include "nvim/map_defs.h"
#include "nvim/mapping.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memfile_defs.h"
+#include "nvim/memline.h"
+#include "nvim/memline_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/move.h"
#include "nvim/normal.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/time.h"
#include "nvim/path.h"
#include "nvim/plines.h"
#include "nvim/pos_defs.h"
#include "nvim/quickfix.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/search.h"
#include "nvim/spell.h"
#include "nvim/state_defs.h"
@@ -4137,3 +4151,49 @@ int buf_open_scratch(handle_T bufnr, char *bufname)
RESET_BINDING(curwin);
return OK;
}
+
+bool buf_is_empty(buf_T *buf)
+{
+ return buf->b_ml.ml_line_count == 1 && *ml_get_buf(buf, 1) == '\0';
+}
+
+/// Increment b:changedtick value
+///
+/// Also checks b: for consistency in case of debug build.
+///
+/// @param[in,out] buf Buffer to increment value in.
+void buf_inc_changedtick(buf_T *const buf)
+ FUNC_ATTR_NONNULL_ALL
+{
+ buf_set_changedtick(buf, buf_get_changedtick(buf) + 1);
+}
+
+/// Set b:changedtick, also checking b: for consistency in debug build
+///
+/// @param[out] buf Buffer to set changedtick in.
+/// @param[in] changedtick New value.
+void buf_set_changedtick(buf_T *const buf, const varnumber_T changedtick)
+ FUNC_ATTR_NONNULL_ALL
+{
+ typval_T old_val = buf->changedtick_di.di_tv;
+
+#ifndef NDEBUG
+ dictitem_T *const changedtick_di = tv_dict_find(buf->b_vars, S_LEN("changedtick"));
+ assert(changedtick_di != NULL);
+ assert(changedtick_di->di_tv.v_type == VAR_NUMBER);
+ assert(changedtick_di->di_tv.v_lock == VAR_FIXED);
+ // For some reason formatc does not like the below.
+# ifndef UNIT_TESTING_LUA_PREPROCESSING
+ assert(changedtick_di->di_flags == (DI_FLAGS_RO|DI_FLAGS_FIX));
+# endif
+ assert(changedtick_di == (dictitem_T *)&buf->changedtick_di);
+#endif
+ buf->changedtick_di.di_tv.vval.v_number = changedtick;
+
+ if (tv_dict_is_watched(buf->b_vars)) {
+ tv_dict_watcher_notify(buf->b_vars,
+ (char *)buf->changedtick_di.di_key,
+ &buf->changedtick_di.di_tv,
+ &old_val);
+ }
+}
diff --git a/src/nvim/buffer.h b/src/nvim/buffer.h
index af30870776..4ad7144ad9 100644
--- a/src/nvim/buffer.h
+++ b/src/nvim/buffer.h
@@ -1,14 +1,11 @@
#pragma once
-#include <assert.h>
-#include <stdbool.h>
-#include <stddef.h>
-
-#include "nvim/buffer_defs.h" // IWYU pragma: export
-#include "nvim/eval/typval.h"
+#include "nvim/buffer_defs.h" // IWYU pragma: keep
+#include "nvim/eval/typval_defs.h"
+#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/func_attr.h"
+#include "nvim/gettext_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
-#include "nvim/memline.h"
#include "nvim/types_defs.h"
/// Values for buflist_getfile()
@@ -71,38 +68,6 @@ EXTERN char *msg_qflist INIT( = N_("[Quickfix List]"));
# include "buffer.h.generated.h"
#endif
-static inline void buf_set_changedtick(buf_T *buf, varnumber_T changedtick)
- REAL_FATTR_NONNULL_ALL REAL_FATTR_ALWAYS_INLINE;
-
-/// Set b:changedtick, also checking b: for consistency in debug build
-///
-/// @param[out] buf Buffer to set changedtick in.
-/// @param[in] changedtick New value.
-static inline void buf_set_changedtick(buf_T *const buf, const varnumber_T changedtick)
-{
- typval_T old_val = buf->changedtick_di.di_tv;
-
-#ifndef NDEBUG
- dictitem_T *const changedtick_di = tv_dict_find(buf->b_vars, S_LEN("changedtick"));
- assert(changedtick_di != NULL);
- assert(changedtick_di->di_tv.v_type == VAR_NUMBER);
- assert(changedtick_di->di_tv.v_lock == VAR_FIXED);
- // For some reason formatc does not like the below.
-# ifndef UNIT_TESTING_LUA_PREPROCESSING
- assert(changedtick_di->di_flags == (DI_FLAGS_RO|DI_FLAGS_FIX));
-# endif
- assert(changedtick_di == (dictitem_T *)&buf->changedtick_di);
-#endif
- buf->changedtick_di.di_tv.vval.v_number = changedtick;
-
- if (tv_dict_is_watched(buf->b_vars)) {
- tv_dict_watcher_notify(buf->b_vars,
- (char *)buf->changedtick_di.di_key,
- &buf->changedtick_di.di_tv,
- &old_val);
- }
-}
-
static inline varnumber_T buf_get_changedtick(const buf_T *buf)
REAL_FATTR_NONNULL_ALL REAL_FATTR_ALWAYS_INLINE REAL_FATTR_PURE
REAL_FATTR_WARN_UNUSED_RESULT;
@@ -116,21 +81,3 @@ static inline varnumber_T buf_get_changedtick(const buf_T *const buf)
{
return buf->changedtick_di.di_tv.vval.v_number;
}
-
-static inline void buf_inc_changedtick(buf_T *buf)
- REAL_FATTR_NONNULL_ALL REAL_FATTR_ALWAYS_INLINE;
-
-/// Increment b:changedtick value
-///
-/// Also checks b: for consistency in case of debug build.
-///
-/// @param[in,out] buf Buffer to increment value in.
-static inline void buf_inc_changedtick(buf_T *const buf)
-{
- buf_set_changedtick(buf, buf_get_changedtick(buf) + 1);
-}
-
-static inline bool buf_is_empty(buf_T *buf)
-{
- return buf->b_ml.ml_line_count == 1 && *ml_get_buf(buf, 1) == '\0';
-}
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 085070fc4a..f09aa70ef4 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -4,27 +4,14 @@
#include <stdint.h>
#include <stdio.h>
-#include "klib/kvec.h"
-#include "nvim/api/private/defs.h"
#include "nvim/arglist_defs.h"
-#include "nvim/eval/typval_defs.h"
-#include "nvim/extmark_defs.h"
-#include "nvim/garray_defs.h"
#include "nvim/grid_defs.h"
-#include "nvim/hashtab_defs.h"
-#include "nvim/highlight_defs.h"
-#include "nvim/map_defs.h"
#include "nvim/mapping_defs.h"
-#include "nvim/mark_defs.h"
#include "nvim/marktree_defs.h"
#include "nvim/memline_defs.h"
#include "nvim/option_defs.h"
#include "nvim/os/fs_defs.h"
-#include "nvim/pos_defs.h"
-#include "nvim/regexp_defs.h"
-#include "nvim/sign_defs.h"
#include "nvim/statusline_defs.h"
-#include "nvim/types_defs.h"
#include "nvim/undo_defs.h"
/// Reference to a buffer that stores the value of buf_free_count.
diff --git a/src/nvim/buffer_updates.c b/src/nvim/buffer_updates.c
index 7985d6931f..a91a890d0e 100644
--- a/src/nvim/buffer_updates.c
+++ b/src/nvim/buffer_updates.c
@@ -5,6 +5,7 @@
#include "klib/kvec.h"
#include "nvim/api/buffer.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/assert_defs.h"
#include "nvim/buffer.h"
diff --git a/src/nvim/bufwrite.c b/src/nvim/bufwrite.c
index 25f69094f4..94a6604fc1 100644
--- a/src/nvim/bufwrite.c
+++ b/src/nvim/bufwrite.c
@@ -12,7 +12,9 @@
#include "auto/config.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/bufwrite.h"
#include "nvim/change.h"
#include "nvim/drawscreen.h"
@@ -22,19 +24,22 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_eval.h"
#include "nvim/fileio.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/iconv_defs.h"
#include "nvim/input.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
+#include "nvim/memline_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option.h"
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/input.h"
#include "nvim/os/os_defs.h"
#include "nvim/path.h"
@@ -44,6 +49,7 @@
#include "nvim/types_defs.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
+#include "nvim/undo_defs.h"
#include "nvim/vim_defs.h"
static const char *err_readonly = "is read-only (cannot override: \"W\" in 'cpoptions')";
diff --git a/src/nvim/change.c b/src/nvim/change.c
index 82bb703b6f..09312118f6 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -8,7 +8,9 @@
#include "nvim/ascii_defs.h"
#include "nvim/assert_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/buffer_updates.h"
#include "nvim/change.h"
#include "nvim/charset.h"
@@ -19,17 +21,22 @@
#include "nvim/eval.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/extmark.h"
+#include "nvim/extmark_defs.h"
#include "nvim/fold.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
#include "nvim/insexpand.h"
#include "nvim/macros_defs.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
+#include "nvim/memline_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/move.h"
@@ -41,6 +48,7 @@
#include "nvim/search.h"
#include "nvim/spell.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/textformat.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/channel.c b/src/nvim/channel.c
index d2b064ef3c..05148801f4 100644
--- a/src/nvim/channel.c
+++ b/src/nvim/channel.c
@@ -7,8 +7,10 @@
#include "klib/kvec.h"
#include "nvim/api/private/converter.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/channel.h"
#include "nvim/eval.h"
@@ -16,12 +18,13 @@
#include "nvim/eval/typval.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
+#include "nvim/event/process.h"
#include "nvim/event/rstream.h"
#include "nvim/event/socket.h"
#include "nvim/event/stream.h"
#include "nvim/event/wstream.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/log.h"
#include "nvim/lua/executor.h"
@@ -35,6 +38,7 @@
#include "nvim/os/shell.h"
#include "nvim/path.h"
#include "nvim/rbuffer.h"
+#include "nvim/rbuffer_defs.h"
#include "nvim/terminal.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/channel.h b/src/nvim/channel.h
index e77f17d3e0..35d369e513 100644
--- a/src/nvim/channel.h
+++ b/src/nvim/channel.h
@@ -4,10 +4,10 @@
#include <stdint.h>
#include <stdlib.h>
-#include "nvim/channel_defs.h" // IWYU pragma: export
+#include "nvim/channel_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h"
+#include "nvim/event/defs.h"
#include "nvim/event/libuv_process.h"
-#include "nvim/event/process.h"
#include "nvim/func_attr.h"
#include "nvim/macros_defs.h"
#include "nvim/map_defs.h"
diff --git a/src/nvim/channel_defs.h b/src/nvim/channel_defs.h
index f6475129ff..d4f1895420 100644
--- a/src/nvim/channel_defs.h
+++ b/src/nvim/channel_defs.h
@@ -3,13 +3,7 @@
#include <stdint.h>
#include <stdlib.h>
-#include "nvim/eval/typval_defs.h"
#include "nvim/event/defs.h"
-#include "nvim/garray_defs.h"
-#include "nvim/macros_defs.h"
-#include "nvim/map_defs.h"
-#include "nvim/msgpack_rpc/channel_defs.h"
-#include "nvim/types_defs.h"
#define CHAN_STDIO 1
#define CHAN_STDERR 2
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index 82a2a3bfe7..81a42e619c 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -18,6 +18,7 @@
#include "nvim/cursor.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/globals.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c
index 968081c6ac..c5f1bfeb87 100644
--- a/src/nvim/cmdexpand.c
+++ b/src/nvim/cmdexpand.c
@@ -8,11 +8,13 @@
#include <string.h>
#include <uv.h>
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/arglist.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand.h"
#include "nvim/cmdhist.h"
@@ -23,17 +25,20 @@
#include "nvim/eval/typval_defs.h"
#include "nvim/eval/userfunc.h"
#include "nvim/ex_cmds.h"
+#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/garray.h"
#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/hashtab.h"
+#include "nvim/hashtab_defs.h"
#include "nvim/help.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/keycodes.h"
#include "nvim/log.h"
@@ -41,6 +46,7 @@
#include "nvim/macros_defs.h"
#include "nvim/mapping.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memory.h"
#include "nvim/menu.h"
#include "nvim/message.h"
@@ -49,11 +55,13 @@
#include "nvim/os/fs.h"
#include "nvim/os/lang.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/popupmenu.h"
#include "nvim/profile.h"
#include "nvim/regexp.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/search.h"
#include "nvim/sign.h"
#include "nvim/statusline.h"
@@ -62,6 +70,7 @@
#include "nvim/tag.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/usercmd.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
diff --git a/src/nvim/cmdexpand.h b/src/nvim/cmdexpand.h
index a45b334cfb..33ff787589 100644
--- a/src/nvim/cmdexpand.h
+++ b/src/nvim/cmdexpand.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/cmdexpand_defs.h" // IWYU pragma: export
+#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/ex_getln_defs.h" // IWYU pragma: keep
#include "nvim/garray_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/cmdexpand_defs.h b/src/nvim/cmdexpand_defs.h
index 923ba62099..c1fb85859c 100644
--- a/src/nvim/cmdexpand_defs.h
+++ b/src/nvim/cmdexpand_defs.h
@@ -4,7 +4,6 @@
#include <stddef.h>
#include "nvim/eval/typval_defs.h"
-#include "nvim/types_defs.h"
typedef enum {
XP_PREFIX_NONE, ///< prefix not used
diff --git a/src/nvim/cmdhist.c b/src/nvim/cmdhist.c
index 51a73dec10..6a9290270a 100644
--- a/src/nvim/cmdhist.c
+++ b/src/nvim/cmdhist.c
@@ -15,7 +15,7 @@
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_getln.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/macros_defs.h"
#include "nvim/memory.h"
@@ -23,6 +23,7 @@
#include "nvim/option_vars.h"
#include "nvim/os/time.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/vim_defs.h"
diff --git a/src/nvim/context.c b/src/nvim/context.c
index dfb214d065..7ce906b244 100644
--- a/src/nvim/context.c
+++ b/src/nvim/context.c
@@ -14,12 +14,14 @@
#include "nvim/context.h"
#include "nvim/eval/encode.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/eval/userfunc.h"
#include "nvim/ex_docmd.h"
#include "nvim/hashtab.h"
#include "nvim/keycodes.h"
#include "nvim/memory.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/shada.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c
index 10b8a58ef4..d8a63c1d7b 100644
--- a/src/nvim/cursor.c
+++ b/src/nvim/cursor.c
@@ -21,6 +21,7 @@
#include "nvim/plines.h"
#include "nvim/pos_defs.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/types_defs.h"
#include "nvim/vim_defs.h"
diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c
index 7461dc7288..67bb34d4ea 100644
--- a/src/nvim/cursor_shape.c
+++ b/src/nvim/cursor_shape.c
@@ -8,7 +8,7 @@
#include "nvim/charset.h"
#include "nvim/cursor_shape.h"
#include "nvim/ex_getln.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight_group.h"
#include "nvim/log.h"
diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c
index e41ba9fb54..7d87b61ce5 100644
--- a/src/nvim/debugger.c
+++ b/src/nvim/debugger.c
@@ -15,23 +15,28 @@
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/getchar_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/state_defs.h"
#include "nvim/types_defs.h"
#include "nvim/vim_defs.h"
diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c
index 95b1443931..e27c2beacf 100644
--- a/src/nvim/decoration.c
+++ b/src/nvim/decoration.c
@@ -5,6 +5,7 @@
#include <string.h>
#include "nvim/api/extmark.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer_defs.h"
@@ -13,6 +14,7 @@
#include "nvim/extmark.h"
#include "nvim/fold.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/highlight.h"
#include "nvim/highlight_group.h"
#include "nvim/map_defs.h"
diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h
index d8fd432880..b3ff737123 100644
--- a/src/nvim/decoration.h
+++ b/src/nvim/decoration.h
@@ -5,7 +5,7 @@
#include <stdint.h>
#include "klib/kvec.h"
-#include "nvim/decoration_defs.h" // IWYU pragma: export
+#include "nvim/decoration_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
#include "nvim/marktree_defs.h"
#include "nvim/pos_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/decoration_provider.c b/src/nvim/decoration_provider.c
index 4b82ae257c..cd55219bf6 100644
--- a/src/nvim/decoration_provider.c
+++ b/src/nvim/decoration_provider.c
@@ -5,6 +5,7 @@
#include "klib/kvec.h"
#include "nvim/api/extmark.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/buffer_defs.h"
#include "nvim/decoration.h"
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index f8aed21556..2b3010e063 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -18,6 +18,7 @@
#include "auto/config.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
#include "nvim/bufwrite.h"
#include "nvim/change.h"
@@ -30,24 +31,30 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/extmark.h"
+#include "nvim/extmark_defs.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/linematch.h"
#include "nvim/mark.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/move.h"
#include "nvim/normal.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/shell.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c
index c8c6e5baa0..f91ff9274b 100644
--- a/src/nvim/digraph.c
+++ b/src/nvim/digraph.c
@@ -19,12 +19,14 @@
#include "nvim/ex_getln.h"
#include "nvim/garray.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/keycodes.h"
#include "nvim/mapping.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/normal.h"
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index a4d98f09f4..5ccfb24b8a 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -11,6 +11,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/cursor_shape.h"
@@ -25,10 +26,12 @@
#include "nvim/fold_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/indent.h"
-#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/match.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
@@ -40,15 +43,18 @@
#include "nvim/plines.h"
#include "nvim/pos_defs.h"
#include "nvim/quickfix.h"
-#include "nvim/sign.h"
+#include "nvim/sign_defs.h"
#include "nvim/spell.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/statusline.h"
+#include "nvim/statusline_defs.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
#include "nvim/terminal.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/vim_defs.h"
#define MB_FILLER_CHAR '<' // character used when a double-width character doesn't fit.
@@ -2611,8 +2617,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
// When the window is too narrow draw all "@" lines.
if (leftcols_width >= wp->w_grid.cols && wp->w_p_wrap) {
- win_draw_end(wp, schar_from_ascii('@'), schar_from_ascii(' '), true, wlv.row,
- wp->w_grid.rows, HLF_AT);
+ win_draw_end(wp, schar_from_ascii('@'), true, wlv.row, wp->w_grid.rows, HLF_AT);
set_empty_rows(wp, wlv.row);
wlv.row = endrow;
}
@@ -2836,8 +2841,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl
// When the window is too narrow draw all "@" lines.
if (wlv.col <= leftcols_width) {
- win_draw_end(wp, schar_from_ascii('@'), schar_from_ascii(' '), true, wlv.row,
- wp->w_grid.rows, HLF_AT);
+ win_draw_end(wp, schar_from_ascii('@'), true, wlv.row, wp->w_grid.rows, HLF_AT);
set_empty_rows(wp, wlv.row);
wlv.row = endrow;
}
@@ -2883,8 +2887,7 @@ static void win_put_linebuf(win_T *wp, int row, int coloff, int endcol, int clea
int start_col = 0;
if (wp->w_p_rl) {
- linebuf_mirror(&start_col, &clear_width, grid->cols);
- endcol = grid->cols - 1 - endcol;
+ linebuf_mirror(&start_col, &endcol, &clear_width, grid->cols);
}
// Take care of putting "<<<" on the first line for 'smoothscroll'.
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c
index 12f06e13cc..7f794a58d2 100644
--- a/src/nvim/drawscreen.c
+++ b/src/nvim/drawscreen.c
@@ -63,11 +63,13 @@
#include "nvim/api/private/defs.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand.h"
#include "nvim/cursor.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/decoration_provider.h"
#include "nvim/diff.h"
#include "nvim/digraph.h"
@@ -76,11 +78,14 @@
#include "nvim/eval.h"
#include "nvim/ex_getln.h"
#include "nvim/fold.h"
+#include "nvim/fold_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/insexpand.h"
#include "nvim/match.h"
@@ -89,6 +94,7 @@
#include "nvim/message.h"
#include "nvim/move.h"
#include "nvim/normal.h"
+#include "nvim/normal_defs.h"
#include "nvim/option.h"
#include "nvim/option_vars.h"
#include "nvim/os/os_defs.h"
@@ -100,6 +106,7 @@
#include "nvim/search.h"
#include "nvim/spell.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/statusline.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
@@ -107,6 +114,7 @@
#include "nvim/types_defs.h"
#include "nvim/ui.h"
#include "nvim/ui_compositor.h"
+#include "nvim/ui_defs.h"
#include "nvim/version.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
@@ -1296,9 +1304,11 @@ static void draw_vsep_win(win_T *wp)
}
// draw the vertical separator right of this window
- int hl = win_hl_attr(wp, HLF_C);
- schar_T c = wp->w_p_fcs_chars.vert;
- grid_fill(&default_grid, wp->w_winrow, W_ENDROW(wp), W_ENDCOL(wp), W_ENDCOL(wp) + 1, c, c, hl);
+ for (int row = wp->w_winrow; row < W_ENDROW(wp); row++) {
+ grid_line_start(&default_grid, row);
+ grid_line_put_schar(W_ENDCOL(wp), wp->w_p_fcs_chars.vert, win_hl_attr(wp, HLF_C));
+ grid_line_flush();
+ }
}
/// Draw the horizontal separator below window "wp"
@@ -1309,9 +1319,9 @@ static void draw_hsep_win(win_T *wp)
}
// draw the horizontal separator below this window
- int hl = win_hl_attr(wp, HLF_C);
- schar_T c = wp->w_p_fcs_chars.horiz;
- grid_fill(&default_grid, W_ENDROW(wp), W_ENDROW(wp) + 1, wp->w_wincol, W_ENDCOL(wp), c, c, hl);
+ grid_line_start(&default_grid, W_ENDROW(wp));
+ grid_line_fill(wp->w_wincol, W_ENDCOL(wp), wp->w_p_fcs_chars.horiz, win_hl_attr(wp, HLF_C));
+ grid_line_flush();
}
/// Get the separator connector for specified window corner of window "wp"
@@ -2395,7 +2405,7 @@ static void win_update(win_T *wp)
set_empty_rows(wp, srow);
wp->w_botline = lnum;
} else {
- win_draw_end(wp, wp->w_p_fcs_chars.lastline, schar_from_ascii(' '), true, srow,
+ win_draw_end(wp, wp->w_p_fcs_chars.lastline, true, srow,
wp->w_grid.rows, HLF_AT);
set_empty_rows(wp, srow);
wp->w_botline = lnum;
@@ -2429,7 +2439,7 @@ static void win_update(win_T *wp)
lastline = 0;
}
- win_draw_end(wp, wp->w_p_fcs_chars.eob, schar_from_ascii(' '), false, MAX(lastline, row),
+ win_draw_end(wp, wp->w_p_fcs_chars.eob, false, MAX(lastline, row),
wp->w_grid.rows,
HLF_EOB);
set_empty_rows(wp, row);
@@ -2517,60 +2527,43 @@ void win_scroll_lines(win_T *wp, int row, int line_count)
}
}
-/// Call grid_clear() with columns adjusted for 'rightleft' if needed.
-/// Return the new offset.
-static int win_clear_end(win_T *wp, int off, int width, int row, int endrow, int attr)
-{
- int nn = off + width;
- const int endcol = wp->w_grid.cols;
-
- if (nn > endcol) {
- nn = endcol;
- }
-
- if (wp->w_p_rl) {
- grid_clear(&wp->w_grid, row, endrow, endcol - nn, endcol - off, attr);
- } else {
- grid_clear(&wp->w_grid, row, endrow, off, nn, attr);
- }
-
- return nn;
-}
-
/// Clear lines near the end of the window and mark the unused lines with "c1".
-/// Use "c2" as filler character.
/// When "draw_margin" is true, then draw the sign/fold/number columns.
-void win_draw_end(win_T *wp, schar_T c1, schar_T c2, bool draw_margin, int row, int endrow,
- hlf_T hl)
+void win_draw_end(win_T *wp, schar_T c1, bool draw_margin, int startrow, int endrow, hlf_T hl)
{
assert(hl >= 0 && hl < HLF_COUNT);
- int n = 0;
-
- if (draw_margin) {
- // draw the fold column
- int fdc = compute_foldcolumn(wp, 0);
- if (fdc > 0) {
- n = win_clear_end(wp, n, fdc, row, endrow, win_hl_attr(wp, HLF_FC));
- }
- // draw the sign column
- int count = wp->w_scwidth;
- if (count > 0) {
- n = win_clear_end(wp, n, SIGN_WIDTH * count, row, endrow, win_hl_attr(wp, HLF_SC));
+ for (int row = startrow; row < endrow; row++) {
+ grid_line_start(&wp->w_grid, row);
+
+ int n = 0;
+ if (draw_margin) {
+ // draw the fold column
+ int fdc = MAX(0, compute_foldcolumn(wp, 0));
+ n = grid_line_fill(n, n + fdc, schar_from_ascii(' '), win_hl_attr(wp, HLF_FC));
+
+ // draw the sign column
+ n = grid_line_fill(n, n + wp->w_scwidth, schar_from_ascii(' '), win_hl_attr(wp, HLF_FC));
+
+ // draw the number column
+ if ((wp->w_p_nu || wp->w_p_rnu) && vim_strchr(p_cpo, CPO_NUMCOL) == NULL) {
+ int width = number_width(wp) + 1;
+ n = grid_line_fill(n, n + width, schar_from_ascii(' '), win_hl_attr(wp, HLF_N));
+ }
}
- // draw the number column
- if ((wp->w_p_nu || wp->w_p_rnu) && vim_strchr(p_cpo, CPO_NUMCOL) == NULL) {
- n = win_clear_end(wp, n, number_width(wp) + 1, row, endrow, win_hl_attr(wp, HLF_N));
+
+ int attr = hl_combine_attr(win_bg_attr(wp), win_hl_attr(wp, (int)hl));
+
+ if (n < wp->w_grid.cols) {
+ grid_line_put_schar(n, c1, 0); // base attr is inherited from clear
+ n++;
}
- }
- int attr = hl_combine_attr(win_bg_attr(wp), win_hl_attr(wp, (int)hl));
+ grid_line_clear_end(n, wp->w_grid.cols, attr);
- const int endcol = wp->w_grid.cols;
- if (wp->w_p_rl) {
- grid_fill(&wp->w_grid, row, endrow, 0, endcol - 1 - n, c2, c2, attr);
- grid_fill(&wp->w_grid, row, endrow, endcol - 1 - n, endcol - n, c1, c2, attr);
- } else {
- grid_fill(&wp->w_grid, row, endrow, n, endcol, c1, c2, attr);
+ if (wp->w_p_rl) {
+ grid_line_mirror();
+ }
+ grid_line_flush();
}
}
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 055b0bbfe8..4b472a2fbd 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -11,6 +11,7 @@
#include "nvim/autocmd.h"
#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
@@ -22,13 +23,15 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/extmark.h"
+#include "nvim/extmark_defs.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
@@ -37,13 +40,16 @@
#include "nvim/macros_defs.h"
#include "nvim/mapping.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/mouse.h"
#include "nvim/move.h"
#include "nvim/normal.h"
+#include "nvim/normal_defs.h"
#include "nvim/ops.h"
#include "nvim/option.h"
#include "nvim/option_vars.h"
@@ -53,6 +59,7 @@
#include "nvim/pos_defs.h"
#include "nvim/search.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
#include "nvim/terminal.h"
@@ -60,6 +67,7 @@
#include "nvim/textobject.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/undo.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 451e258356..5826316828 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -11,10 +11,12 @@
#include "auto/config.h"
#include "nvim/api/private/converter.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/channel.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand_defs.h"
@@ -37,20 +39,22 @@
#include "nvim/ex_eval.h"
#include "nvim/ex_getln.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid_defs.h"
#include "nvim/hashtab.h"
#include "nvim/highlight_group.h"
#include "nvim/insexpand.h"
#include "nvim/keycodes.h"
-#include "nvim/lib/queue.h"
+#include "nvim/lib/queue_defs.h"
#include "nvim/lua/executor.h"
#include "nvim/macros_defs.h"
#include "nvim/main.h"
#include "nvim/map_defs.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
@@ -63,8 +67,10 @@
#include "nvim/optionstr.h"
#include "nvim/os/fileio.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/lang.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/shell.h"
#include "nvim/os/stdpaths_defs.h"
#include "nvim/path.h"
@@ -72,13 +78,16 @@
#include "nvim/profile.h"
#include "nvim/quickfix.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/search.h"
#include "nvim/strings.h"
#include "nvim/tag.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
#include "nvim/ui_compositor.h"
+#include "nvim/ui_defs.h"
#include "nvim/usercmd.h"
#include "nvim/version.h"
#include "nvim/vim_defs.h"
diff --git a/src/nvim/eval.h b/src/nvim/eval.h
index abe2685424..d83af70ef7 100644
--- a/src/nvim/eval.h
+++ b/src/nvim/eval.h
@@ -7,7 +7,7 @@
#include "nvim/channel_defs.h" // IWYU pragma: keep
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h"
-#include "nvim/eval_defs.h" // IWYU pragma: export
+#include "nvim/eval_defs.h" // IWYU pragma: keep
#include "nvim/event/defs.h"
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/grid_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/eval/buffer.c b/src/nvim/eval/buffer.c
index 2ae2b94ce9..291a57657d 100644
--- a/src/nvim/eval/buffer.c
+++ b/src/nvim/eval/buffer.c
@@ -5,6 +5,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
#include "nvim/buffer_defs.h"
#include "nvim/change.h"
diff --git a/src/nvim/eval/decode.c b/src/nvim/eval/decode.c
index 64b65b42a5..d7df7bb150 100644
--- a/src/nvim/eval/decode.c
+++ b/src/nvim/eval/decode.c
@@ -14,8 +14,9 @@
#include "nvim/eval/encode.h"
#include "nvim/eval/typval.h"
#include "nvim/eval/typval_defs.h"
+#include "nvim/eval_defs.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
diff --git a/src/nvim/eval/encode.c b/src/nvim/eval/encode.c
index 38be10dbaf..d35ac4eb7b 100644
--- a/src/nvim/eval/encode.c
+++ b/src/nvim/eval/encode.c
@@ -20,7 +20,7 @@
#include "nvim/eval/typval.h"
#include "nvim/eval/typval_encode.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
#include "nvim/macros_defs.h"
@@ -1056,3 +1056,17 @@ char *encode_tv2json(typval_T *tv, size_t *len)
#undef TYPVAL_ENCODE_CONV_LIST_BETWEEN_ITEMS
#undef TYPVAL_ENCODE_CONV_RECURSE
#undef TYPVAL_ENCODE_ALLOW_SPECIALS
+
+/// Initialize ListReaderState structure
+ListReaderState encode_init_lrstate(const list_T *const list)
+ FUNC_ATTR_NONNULL_ALL
+{
+ return (ListReaderState) {
+ .list = list,
+ .li = tv_list_first(list),
+ .offset = 0,
+ .li_length = (TV_LIST_ITEM_TV(tv_list_first(list))->vval.v_string == NULL
+ ? 0
+ : strlen(TV_LIST_ITEM_TV(tv_list_first(list))->vval.v_string)),
+ };
+}
diff --git a/src/nvim/eval/encode.h b/src/nvim/eval/encode.h
index fe1b951e3c..6d1c0b61c5 100644
--- a/src/nvim/eval/encode.h
+++ b/src/nvim/eval/encode.h
@@ -3,8 +3,7 @@
#include <msgpack/pack.h>
#include <string.h>
-#include "nvim/eval/typval.h"
-#include "nvim/func_attr.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/garray_defs.h"
/// Convert Vimscript value to msgpack string
@@ -33,22 +32,6 @@ typedef struct {
size_t li_length; ///< Length of the string inside the read item.
} ListReaderState;
-static inline ListReaderState encode_init_lrstate(const list_T *list)
- REAL_FATTR_NONNULL_ALL;
-
-/// Initialize ListReaderState structure
-static inline ListReaderState encode_init_lrstate(const list_T *const list)
-{
- return (ListReaderState) {
- .list = list,
- .li = tv_list_first(list),
- .offset = 0,
- .li_length = (TV_LIST_ITEM_TV(tv_list_first(list))->vval.v_string == NULL
- ? 0
- : strlen(TV_LIST_ITEM_TV(tv_list_first(list))->vval.v_string)),
- };
-}
-
/// Array mapping values from SpecialVarValue enum to names
extern const char *const encode_bool_var_names[];
extern const char *const encode_special_var_names[];
diff --git a/src/nvim/eval/executor.c b/src/nvim/eval/executor.c
index b483f5fbef..1b8c057d7c 100644
--- a/src/nvim/eval/executor.c
+++ b/src/nvim/eval/executor.c
@@ -6,7 +6,7 @@
#include "nvim/eval/typval.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/message.h"
#include "nvim/strings.h"
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index d843c37082..4d60cd3660 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -19,14 +19,18 @@
#include "auto/config.h"
#include "nvim/api/private/converter.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/dispatch.h"
#include "nvim/api/private/helpers.h"
#include "nvim/api/vim.h"
#include "nvim/ascii_defs.h"
#include "nvim/assert_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/channel.h"
+#include "nvim/channel_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand.h"
#include "nvim/cmdexpand_defs.h"
@@ -45,21 +49,26 @@
#include "nvim/eval/userfunc.h"
#include "nvim/eval/vars.h"
#include "nvim/eval/window.h"
+#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/process.h"
#include "nvim/event/time.h"
#include "nvim/ex_cmds.h"
+#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/ex_getln.h"
#include "nvim/file_search.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/getchar_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/indent.h"
@@ -71,24 +80,34 @@
#include "nvim/macros_defs.h"
#include "nvim/main.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/math.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/menu.h"
+#include "nvim/menu_defs.h"
#include "nvim/message.h"
#include "nvim/move.h"
#include "nvim/msgpack_rpc/channel.h"
+#include "nvim/msgpack_rpc/channel_defs.h"
#include "nvim/msgpack_rpc/server.h"
#include "nvim/normal.h"
+#include "nvim/normal_defs.h"
#include "nvim/ops.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/dl.h"
#include "nvim/os/fileio.h"
+#include "nvim/os/fileio_defs.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/pty_process.h"
#include "nvim/os/shell.h"
#include "nvim/os/stdpaths_defs.h"
@@ -99,12 +118,15 @@
#include "nvim/pos_defs.h"
#include "nvim/profile.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/search.h"
#include "nvim/sha256.h"
#include "nvim/spell.h"
#include "nvim/spellsuggest.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
#include "nvim/tag.h"
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c
index 18168d77b7..2892cb60f9 100644
--- a/src/nvim/eval/typval.c
+++ b/src/nvim/eval/typval.c
@@ -19,10 +19,12 @@
#include "nvim/eval/userfunc.h"
#include "nvim/eval/vars.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
-#include "nvim/lib/queue.h"
+#include "nvim/hashtab_defs.h"
+#include "nvim/lib/queue_defs.h"
#include "nvim/lua/executor.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h
index 0928fdea62..f9ebd2f778 100644
--- a/src/nvim/eval/typval.h
+++ b/src/nvim/eval/typval.h
@@ -6,11 +6,11 @@
#include <stdint.h>
#include <string.h>
-#include "nvim/eval/typval_defs.h" // IWYU pragma: export
+#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/func_attr.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/hashtab.h"
-#include "nvim/lib/queue.h"
+#include "nvim/lib/queue_defs.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte_defs.h" // IWYU pragma: keep
#include "nvim/message.h"
diff --git a/src/nvim/eval/typval_defs.h b/src/nvim/eval/typval_defs.h
index 9c94542d11..0d6ee28adc 100644
--- a/src/nvim/eval/typval_defs.h
+++ b/src/nvim/eval/typval_defs.h
@@ -2,10 +2,11 @@
#include <inttypes.h>
#include <limits.h>
+#include <stdbool.h>
#include "nvim/garray_defs.h"
#include "nvim/hashtab_defs.h"
-#include "nvim/lib/queue.h"
+#include "nvim/lib/queue_defs.h"
#include "nvim/pos_defs.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index e74bf39476..fe10d56d49 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -10,6 +10,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand_defs.h"
@@ -23,10 +24,13 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
+#include "nvim/ex_eval_defs.h"
#include "nvim/ex_getln.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/getchar_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
#include "nvim/insexpand.h"
@@ -41,11 +45,13 @@
#include "nvim/path.h"
#include "nvim/profile.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/runtime.h"
#include "nvim/search.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/vim_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c
index d57874480d..14498a19fc 100644
--- a/src/nvim/eval/vars.c
+++ b/src/nvim/eval/vars.c
@@ -11,6 +11,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/drawscreen.h"
@@ -18,15 +19,17 @@
#include "nvim/eval/encode.h"
#include "nvim/eval/funcs.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/eval/userfunc.h"
#include "nvim/eval/vars.h"
#include "nvim/eval/window.h"
+#include "nvim/eval_defs.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
#include "nvim/macros_defs.h"
diff --git a/src/nvim/eval/window.c b/src/nvim/eval/window.c
index cb9e9293ae..b621cec5f4 100644
--- a/src/nvim/eval/window.c
+++ b/src/nvim/eval/window.c
@@ -15,10 +15,11 @@
#include "nvim/eval/typval_defs.h"
#include "nvim/eval/window.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/macros_defs.h"
-#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/move.h"
diff --git a/src/nvim/eval/window.h b/src/nvim/eval/window.h
index 1b2817edf0..37cb138404 100644
--- a/src/nvim/eval/window.h
+++ b/src/nvim/eval/window.h
@@ -6,7 +6,7 @@
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/os/os_defs.h"
#include "nvim/pos_defs.h"
-#include "nvim/types_defs.h" // IWYU pragma: keep
+#include "nvim/types_defs.h"
/// Structure used by switch_win() to pass values to restore_win()
typedef struct {
diff --git a/src/nvim/event/defs.h b/src/nvim/event/defs.h
index e19ad4c970..9b7d8708be 100644
--- a/src/nvim/event/defs.h
+++ b/src/nvim/event/defs.h
@@ -5,7 +5,9 @@
#include <stdbool.h>
#include <uv.h>
+#include "nvim/eval/typval_defs.h"
#include "nvim/rbuffer_defs.h"
+#include "nvim/types_defs.h"
enum { EVENT_HANDLER_MAX_ARGC = 10, };
@@ -124,3 +126,31 @@ struct socket_watcher {
socket_close_cb close_cb;
MultiQueue *events;
};
+
+typedef enum {
+ kProcessTypeUv,
+ kProcessTypePty,
+} ProcessType;
+
+typedef struct process Process;
+typedef void (*process_exit_cb)(Process *proc, int status, void *data);
+typedef void (*internal_process_cb)(Process *proc);
+
+struct process {
+ ProcessType type;
+ Loop *loop;
+ void *data;
+ int pid, status, refcount;
+ uint8_t exit_signal; // Signal used when killing (on Windows).
+ uint64_t stopped_time; // process_stop() timestamp
+ const char *cwd;
+ char **argv;
+ const char *exepath;
+ dict_T *env;
+ Stream in, out, err;
+ /// Exit handler. If set, user must call process_free().
+ process_exit_cb cb;
+ internal_process_cb internal_exit_cb, internal_close_cb;
+ bool closed, detach, overlapped, fwd_err;
+ MultiQueue *events;
+};
diff --git a/src/nvim/event/libuv_process.c b/src/nvim/event/libuv_process.c
index 65132ec2b1..a7966994e0 100644
--- a/src/nvim/event/libuv_process.c
+++ b/src/nvim/event/libuv_process.c
@@ -4,11 +4,14 @@
#include <uv.h>
#include "nvim/eval/typval.h"
+#include "nvim/event/defs.h"
#include "nvim/event/libuv_process.h"
#include "nvim/event/loop.h"
#include "nvim/event/process.h"
#include "nvim/log.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
+#include "nvim/types_defs.h"
#include "nvim/ui_client.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
@@ -126,3 +129,11 @@ static void exit_cb(uv_process_t *handle, int64_t status, int term_signal)
proc->status = term_signal ? 128 + term_signal : (int)status;
proc->internal_exit_cb(proc);
}
+
+LibuvProcess libuv_process_init(Loop *loop, void *data)
+{
+ LibuvProcess rv = {
+ .process = process_init(loop, kProcessTypeUv, data)
+ };
+ return rv;
+}
diff --git a/src/nvim/event/libuv_process.h b/src/nvim/event/libuv_process.h
index e1e4a6c406..12401dbb35 100644
--- a/src/nvim/event/libuv_process.h
+++ b/src/nvim/event/libuv_process.h
@@ -2,8 +2,7 @@
#include <uv.h>
-#include "nvim/event/process.h"
-#include "nvim/types_defs.h"
+#include "nvim/event/defs.h"
typedef struct {
Process process;
@@ -12,14 +11,6 @@ typedef struct {
uv_stdio_container_t uvstdio[4];
} LibuvProcess;
-static inline LibuvProcess libuv_process_init(Loop *loop, void *data)
-{
- LibuvProcess rv = {
- .process = process_init(loop, kProcessTypeUv, data)
- };
- return rv;
-}
-
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/libuv_process.h.generated.h"
#endif
diff --git a/src/nvim/event/loop.h b/src/nvim/event/loop.h
index adcde4c909..6ecc7cb781 100644
--- a/src/nvim/event/loop.h
+++ b/src/nvim/event/loop.h
@@ -4,7 +4,7 @@
#include <uv.h>
#include "klib/klist.h"
-#include "nvim/event/defs.h" // IWYU pragma: export
+#include "nvim/event/defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
typedef void *WatcherPtr;
diff --git a/src/nvim/event/multiqueue.c b/src/nvim/event/multiqueue.c
index f1b4414cb5..8646173776 100644
--- a/src/nvim/event/multiqueue.c
+++ b/src/nvim/event/multiqueue.c
@@ -48,7 +48,7 @@
#include "nvim/event/defs.h"
#include "nvim/event/multiqueue.h"
-#include "nvim/lib/queue.h"
+#include "nvim/lib/queue_defs.h"
#include "nvim/memory.h"
typedef struct multiqueue_item MultiQueueItem;
diff --git a/src/nvim/event/multiqueue.h b/src/nvim/event/multiqueue.h
index a0cebcea1d..24aaa34ef7 100644
--- a/src/nvim/event/multiqueue.h
+++ b/src/nvim/event/multiqueue.h
@@ -2,7 +2,7 @@
#include <stddef.h> // IWYU pragma: keep
-#include "nvim/event/defs.h" // IWYU pragma: export
+#include "nvim/event/defs.h" // IWYU pragma: keep
#include "nvim/os/time.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c
index 3d9578936c..7460e92766 100644
--- a/src/nvim/event/process.c
+++ b/src/nvim/event/process.c
@@ -16,7 +16,7 @@
#include "nvim/os/pty_process.h"
#include "nvim/os/shell.h"
#include "nvim/os/time.h"
-#include "nvim/rbuffer.h"
+#include "nvim/rbuffer_defs.h"
#include "nvim/ui_client.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h
index a18414a86a..421a470244 100644
--- a/src/nvim/event/process.h
+++ b/src/nvim/event/process.h
@@ -2,40 +2,10 @@
#include <stdbool.h>
#include <stddef.h>
-#include <stdint.h>
-#include "nvim/eval/typval_defs.h"
-#include "nvim/event/defs.h" // IWYU pragma: export
+#include "nvim/event/defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h"
-typedef enum {
- kProcessTypeUv,
- kProcessTypePty,
-} ProcessType;
-
-typedef struct process Process;
-typedef void (*process_exit_cb)(Process *proc, int status, void *data);
-typedef void (*internal_process_cb)(Process *proc);
-
-struct process {
- ProcessType type;
- Loop *loop;
- void *data;
- int pid, status, refcount;
- uint8_t exit_signal; // Signal used when killing (on Windows).
- uint64_t stopped_time; // process_stop() timestamp
- const char *cwd;
- char **argv;
- const char *exepath;
- dict_T *env;
- Stream in, out, err;
- /// Exit handler. If set, user must call process_free().
- process_exit_cb cb;
- internal_process_cb internal_exit_cb, internal_close_cb;
- bool closed, detach, overlapped, fwd_err;
- MultiQueue *events;
-};
-
static inline Process process_init(Loop *loop, ProcessType type, void *data)
{
return (Process) {
diff --git a/src/nvim/event/rstream.c b/src/nvim/event/rstream.c
index c70ddeefb0..f50c8a0e5a 100644
--- a/src/nvim/event/rstream.c
+++ b/src/nvim/event/rstream.c
@@ -12,6 +12,7 @@
#include "nvim/main.h"
#include "nvim/os/os_defs.h"
#include "nvim/rbuffer.h"
+#include "nvim/rbuffer_defs.h"
#include "nvim/types_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/event/rstream.h b/src/nvim/event/rstream.h
index 3b04e5d435..4e2893bf88 100644
--- a/src/nvim/event/rstream.h
+++ b/src/nvim/event/rstream.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/event/defs.h" // IWYU pragma: export
+#include "nvim/event/defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/event/signal.h b/src/nvim/event/signal.h
index 79784f1226..16cd2be951 100644
--- a/src/nvim/event/signal.h
+++ b/src/nvim/event/signal.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/event/defs.h" // IWYU pragma: export
+#include "nvim/event/defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c
index 35db9150b3..4e878a2ecf 100644
--- a/src/nvim/event/socket.c
+++ b/src/nvim/event/socket.c
@@ -12,12 +12,12 @@
#include "nvim/event/multiqueue.h"
#include "nvim/event/socket.h"
#include "nvim/event/stream.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/log.h"
#include "nvim/main.h"
#include "nvim/memory.h"
#include "nvim/os/fs.h"
-#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/event/socket.h b/src/nvim/event/socket.h
index 8dd72234d2..64a77a9a06 100644
--- a/src/nvim/event/socket.h
+++ b/src/nvim/event/socket.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/event/defs.h" // IWYU pragma: export
+#include "nvim/event/defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/event/stream.h b/src/nvim/event/stream.h
index f79c0ebaa3..9bdfc421d6 100644
--- a/src/nvim/event/stream.h
+++ b/src/nvim/event/stream.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/event/defs.h" // IWYU pragma: export
+#include "nvim/event/defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/event/time.h b/src/nvim/event/time.h
index 0b684db897..d1f92a3c0e 100644
--- a/src/nvim/event/time.h
+++ b/src/nvim/event/time.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/event/defs.h" // IWYU pragma: export
+#include "nvim/event/defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/event/wstream.h b/src/nvim/event/wstream.h
index 5994e6d700..a431f940d2 100644
--- a/src/nvim/event/wstream.h
+++ b/src/nvim/event/wstream.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/event/defs.h" // IWYU pragma: export
+#include "nvim/event/defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 7abc8354aa..9a04b941ab 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -18,7 +18,9 @@
#include "nvim/arglist.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/buffer_updates.h"
#include "nvim/bufwrite.h"
#include "nvim/change.h"
@@ -34,6 +36,7 @@
#include "nvim/edit.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h"
#include "nvim/ex_cmds_defs.h"
@@ -41,21 +44,25 @@
#include "nvim/ex_eval.h"
#include "nvim/ex_getln.h"
#include "nvim/extmark.h"
+#include "nvim/extmark_defs.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/help.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/indent.h"
#include "nvim/input.h"
#include "nvim/macros_defs.h"
#include "nvim/main.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
+#include "nvim/memline_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/mouse.h"
@@ -63,11 +70,14 @@
#include "nvim/normal.h"
#include "nvim/ops.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/shell.h"
#include "nvim/os/time.h"
#include "nvim/path.h"
@@ -76,6 +86,7 @@
#include "nvim/profile.h"
#include "nvim/quickfix.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/search.h"
#include "nvim/spell.h"
#include "nvim/state_defs.h"
@@ -83,6 +94,7 @@
#include "nvim/terminal.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/undo.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
diff --git a/src/nvim/ex_cmds.h b/src/nvim/ex_cmds.h
index c3e4a799b5..e0894cf7a8 100644
--- a/src/nvim/ex_cmds.h
+++ b/src/nvim/ex_cmds.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/ex_cmds_defs.h" // IWYU pragma: export
+#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
/// flags for do_ecmd()
enum {
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 504078bcf6..234a927291 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -11,12 +11,15 @@
#include "nvim/arglist.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/bufwrite.h"
#include "nvim/change.h"
#include "nvim/channel.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/eval/vars.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h"
@@ -24,9 +27,10 @@
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/macros_defs.h"
#include "nvim/mark.h"
#include "nvim/memory.h"
diff --git a/src/nvim/ex_cmds_defs.h b/src/nvim/ex_cmds_defs.h
index 89b8999674..827680cbb5 100644
--- a/src/nvim/ex_cmds_defs.h
+++ b/src/nvim/ex_cmds_defs.h
@@ -5,9 +5,7 @@
#include "nvim/eval/typval_defs.h"
#include "nvim/ex_eval_defs.h"
-#include "nvim/normal_defs.h"
#include "nvim/os/time_defs.h"
-#include "nvim/pos_defs.h"
#include "nvim/regexp_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 49c5f4e610..7c3eb47247 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -12,9 +12,12 @@
#include <uv.h>
#include "auto/config.h"
+#include "nvim/api/private/defs.h"
+#include "nvim/api/private/helpers.h"
#include "nvim/arglist.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
#include "nvim/buffer_defs.h"
#include "nvim/change.h"
@@ -28,6 +31,7 @@
#include "nvim/edit.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/eval/userfunc.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
@@ -36,15 +40,18 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
+#include "nvim/ex_eval_defs.h"
#include "nvim/ex_getln.h"
#include "nvim/file_search.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/input.h"
#include "nvim/keycodes.h"
@@ -52,20 +59,25 @@
#include "nvim/macros_defs.h"
#include "nvim/main.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
+#include "nvim/memline_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/mouse.h"
#include "nvim/move.h"
#include "nvim/normal.h"
+#include "nvim/normal_defs.h"
#include "nvim/ops.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/fs.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/shell.h"
#include "nvim/path.h"
#include "nvim/popupmenu.h"
@@ -73,16 +85,20 @@
#include "nvim/profile.h"
#include "nvim/quickfix.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/search.h"
#include "nvim/shada.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/statusline.h"
#include "nvim/strings.h"
#include "nvim/tag.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
+#include "nvim/undo_defs.h"
#include "nvim/usercmd.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c
index 90dfa45c47..472741d537 100644
--- a/src/nvim/ex_eval.c
+++ b/src/nvim/ex_eval.c
@@ -13,18 +13,22 @@
#include "nvim/debugger.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/eval/userfunc.h"
+#include "nvim/eval_defs.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/ex_eval_defs.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option_vars.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/strings.h"
#include "nvim/vim_defs.h"
diff --git a/src/nvim/ex_eval.h b/src/nvim/ex_eval.h
index 0294acd109..d46d9c695a 100644
--- a/src/nvim/ex_eval.h
+++ b/src/nvim/ex_eval.h
@@ -1,7 +1,7 @@
#pragma once
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
-#include "nvim/ex_eval_defs.h" // IWYU pragma: export
+#include "nvim/ex_eval_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ex_eval.h.generated.h"
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 2f2cb3f9e8..d10214b48f 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -11,14 +11,18 @@
#include "klib/kvec.h"
#include "nvim/api/extmark.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/api/vim.h"
#include "nvim/arabic.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand.h"
+#include "nvim/cmdexpand_defs.h"
#include "nvim/cmdhist.h"
#include "nvim/cursor.h"
#include "nvim/digraph.h"
@@ -34,19 +38,23 @@
#include "nvim/ex_getln.h"
#include "nvim/extmark.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
#include "nvim/map_defs.h"
#include "nvim/mapping.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/message.h"
#include "nvim/mouse.h"
#include "nvim/move.h"
@@ -63,16 +71,21 @@
#include "nvim/pos_defs.h"
#include "nvim/profile.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/search.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/undo.h"
+#include "nvim/undo_defs.h"
#include "nvim/usercmd.h"
#include "nvim/vim_defs.h"
#include "nvim/viml/parser/expressions.h"
#include "nvim/viml/parser/parser.h"
+#include "nvim/viml/parser/parser_defs.h"
#include "nvim/window.h"
/// Last value of prompt_id, incremented when doing new prompt
diff --git a/src/nvim/ex_getln.h b/src/nvim/ex_getln.h
index af08970f0b..3e14ea12b8 100644
--- a/src/nvim/ex_getln.h
+++ b/src/nvim/ex_getln.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/ex_getln_defs.h" // IWYU pragma: export
+#include "nvim/ex_getln_defs.h" // IWYU pragma: keep
#include "nvim/option_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c
index 887a0356c1..3e15641be8 100644
--- a/src/nvim/ex_session.c
+++ b/src/nvim/ex_session.c
@@ -10,10 +10,13 @@
#include <string.h>
#include "nvim/arglist.h"
+#include "nvim/arglist_defs.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
@@ -21,8 +24,8 @@
#include "nvim/file_search.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
-#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/macros_defs.h"
#include "nvim/mapping.h"
@@ -33,6 +36,7 @@
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/runtime.h"
diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c
index 69b10dd674..583d7eb061 100644
--- a/src/nvim/extmark.c
+++ b/src/nvim/extmark.c
@@ -32,6 +32,7 @@
#include "nvim/buffer_defs.h"
#include "nvim/buffer_updates.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/extmark.h"
#include "nvim/extmark_defs.h"
#include "nvim/globals.h"
@@ -41,6 +42,7 @@
#include "nvim/pos_defs.h"
#include "nvim/types_defs.h"
#include "nvim/undo.h"
+#include "nvim/undo_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "extmark.c.generated.h"
diff --git a/src/nvim/extmark.h b/src/nvim/extmark.h
index 2f2491f8a4..a68bbf33f2 100644
--- a/src/nvim/extmark.h
+++ b/src/nvim/extmark.h
@@ -4,7 +4,7 @@
#include <stdint.h>
#include "klib/kvec.h"
-#include "nvim/extmark_defs.h" // IWYU pragma: export
+#include "nvim/extmark_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
#include "nvim/marktree_defs.h"
#include "nvim/pos_defs.h"
diff --git a/src/nvim/extmark_defs.h b/src/nvim/extmark_defs.h
index c5a8684545..71150cf07c 100644
--- a/src/nvim/extmark_defs.h
+++ b/src/nvim/extmark_defs.h
@@ -1,7 +1,6 @@
#pragma once
#include "klib/kvec.h"
-#include "nvim/types_defs.h"
// TODO(bfredl): good enough name for now.
typedef ptrdiff_t bcount_t;
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c
index 783bbf9d7d..ed4848b402 100644
--- a/src/nvim/file_search.c
+++ b/src/nvim/file_search.c
@@ -51,11 +51,13 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/file_search.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
@@ -64,8 +66,10 @@
#include "nvim/option.h"
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/strings.h"
#include "nvim/vim_defs.h"
diff --git a/src/nvim/file_search.h b/src/nvim/file_search.h
index a2d578a668..2450472681 100644
--- a/src/nvim/file_search.h
+++ b/src/nvim/file_search.h
@@ -1,5 +1,7 @@
#pragma once
+#include <stddef.h> // IWYU pragma: keep
+
#include "nvim/types_defs.h" // IWYU pragma: keep
#include "nvim/vim_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 85656650b6..a06a773f47 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -18,7 +18,9 @@
#include "auto/config.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/buffer_updates.h"
#include "nvim/change.h"
#include "nvim/cursor.h"
@@ -33,19 +35,24 @@
#include "nvim/garray.h"
#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/iconv_defs.h"
#include "nvim/log.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memfile.h"
+#include "nvim/memfile_defs.h"
#include "nvim/memline.h"
+#include "nvim/memline_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/move.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/fs.h"
@@ -56,6 +63,7 @@
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/sha256.h"
#include "nvim/shada.h"
#include "nvim/state_defs.h"
@@ -63,6 +71,7 @@
#include "nvim/types_defs.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
+#include "nvim/undo_defs.h"
#include "nvim/vim_defs.h"
#ifdef BACKSLASH_IN_FILENAME
diff --git a/src/nvim/fold.c b/src/nvim/fold.c
index 6cbf94dced..0ef9e48e3e 100644
--- a/src/nvim/fold.c
+++ b/src/nvim/fold.c
@@ -11,6 +11,7 @@
#include "klib/kvec.h"
#include "nvim/api/extmark.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer_defs.h"
@@ -25,13 +26,15 @@
#include "nvim/eval/typval.h"
#include "nvim/ex_session.h"
#include "nvim/extmark.h"
+#include "nvim/extmark_defs.h"
#include "nvim/fold.h"
#include "nvim/garray.h"
#include "nvim/garray_defs.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/indent.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
diff --git a/src/nvim/fold.h b/src/nvim/fold.h
index 887787578e..f9044d247f 100644
--- a/src/nvim/fold.h
+++ b/src/nvim/fold.h
@@ -4,7 +4,7 @@
#include "nvim/decoration_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
-#include "nvim/fold_defs.h" // IWYU pragma: export
+#include "nvim/fold_defs.h" // IWYU pragma: keep
#include "nvim/garray_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
#include "nvim/pos_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/garray.c b/src/nvim/garray.c
index 28339c3059..f87a196361 100644
--- a/src/nvim/garray.c
+++ b/src/nvim/garray.c
@@ -217,3 +217,12 @@ void ga_append(garray_T *gap, uint8_t c)
{
GA_APPEND(uint8_t, gap, c);
}
+
+void *ga_append_via_ptr(garray_T *gap, size_t item_size)
+{
+ if ((int)item_size != gap->ga_itemsize) {
+ WLOG("wrong item size (%zu), should be %d", item_size, gap->ga_itemsize);
+ }
+ ga_grow(gap, 1);
+ return ((char *)gap->ga_data) + (item_size * (size_t)gap->ga_len++);
+}
diff --git a/src/nvim/garray.h b/src/nvim/garray.h
index dd355984b3..7a766f988a 100644
--- a/src/nvim/garray.h
+++ b/src/nvim/garray.h
@@ -3,8 +3,7 @@
#include <stdbool.h>
#include <stddef.h>
-#include "nvim/garray_defs.h" // IWYU pragma: export
-#include "nvim/log.h"
+#include "nvim/garray_defs.h" // IWYU pragma: keep
#include "nvim/memory.h"
#define GA_EMPTY(ga_ptr) ((ga_ptr)->ga_len <= 0)
@@ -23,15 +22,6 @@
# include "garray.h.generated.h"
#endif
-static inline void *ga_append_via_ptr(garray_T *gap, size_t item_size)
-{
- if ((int)item_size != gap->ga_itemsize) {
- WLOG("wrong item size (%zu), should be %d", item_size, gap->ga_itemsize);
- }
- ga_grow(gap, 1);
- return ((char *)gap->ga_data) + (item_size * (size_t)gap->ga_len++);
-}
-
/// Deep free a garray of specific type using a custom free function.
/// Items in the array as well as the array itself are freed.
///
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 6842aeddcb..23937a6bb5 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -11,6 +11,7 @@
#include <stdlib.h>
#include <string.h>
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer_defs.h"
@@ -27,8 +28,9 @@
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/input.h"
#include "nvim/insexpand.h"
@@ -36,21 +38,26 @@
#include "nvim/lua/executor.h"
#include "nvim/main.h"
#include "nvim/mapping.h"
+#include "nvim/mapping_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/mouse.h"
#include "nvim/move.h"
#include "nvim/normal.h"
+#include "nvim/normal_defs.h"
#include "nvim/ops.h"
#include "nvim/option_vars.h"
#include "nvim/os/fileio.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/plines.h"
#include "nvim/pos_defs.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
diff --git a/src/nvim/getchar.h b/src/nvim/getchar.h
index 6e41bef298..79f4f1f8ba 100644
--- a/src/nvim/getchar.h
+++ b/src/nvim/getchar.h
@@ -4,7 +4,7 @@
#include <stdint.h> // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
-#include "nvim/getchar_defs.h" // IWYU pragma: export
+#include "nvim/getchar_defs.h" // IWYU pragma: keep
#include "nvim/os/fileio_defs.h"
#include "nvim/types_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/gettext.h b/src/nvim/gettext_defs.h
index 2c7b5626d2..2c7b5626d2 100644
--- a/src/nvim/gettext.h
+++ b/src/nvim/gettext_defs.h
diff --git a/src/nvim/grid.c b/src/nvim/grid.c
index f529e14b35..e4a34ae74a 100644
--- a/src/nvim/grid.c
+++ b/src/nvim/grid.c
@@ -22,14 +22,17 @@
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/log.h"
#include "nvim/map_defs.h"
+#include "nvim/mbyte.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "grid.c.generated.h"
@@ -334,6 +337,9 @@ static int grid_line_coloff = 0;
static int grid_line_maxcol = 0;
static int grid_line_first = INT_MAX;
static int grid_line_last = 0;
+static int grid_line_clear_to = 0;
+static int grid_line_clear_attr = 0;
+static bool grid_line_rl = false;
/// Start a group of grid_line_puts calls that builds a single grid line.
///
@@ -342,14 +348,18 @@ static int grid_line_last = 0;
void grid_line_start(ScreenGrid *grid, int row)
{
int col = 0;
+ grid_line_maxcol = grid->cols;
grid_adjust(&grid, &row, &col);
assert(grid_line_grid == NULL);
grid_line_row = row;
grid_line_grid = grid;
grid_line_coloff = col;
grid_line_first = (int)linebuf_size;
- grid_line_maxcol = grid->cols - grid_line_coloff;
+ grid_line_maxcol = MIN(grid_line_maxcol, grid->cols - grid_line_coloff);
grid_line_last = 0;
+ grid_line_clear_to = 0;
+ grid_line_clear_attr = 0;
+ grid_line_rl = false;
assert((size_t)grid_line_maxcol <= linebuf_size);
@@ -465,11 +475,11 @@ int grid_line_puts(int col, const char *text, int textlen, int attr)
return col - start_col;
}
-void grid_line_fill(int start_col, int end_col, schar_T sc, int attr)
+int grid_line_fill(int start_col, int end_col, schar_T sc, int attr)
{
end_col = MIN(end_col, grid_line_maxcol);
if (start_col >= end_col) {
- return;
+ return end_col;
}
for (int col = start_col; col < end_col; col++) {
@@ -480,6 +490,17 @@ void grid_line_fill(int start_col, int end_col, schar_T sc, int attr)
grid_line_first = MIN(grid_line_first, start_col);
grid_line_last = MAX(grid_line_last, end_col);
+ return end_col;
+}
+
+void grid_line_clear_end(int start_col, int end_col, int attr)
+{
+ if (grid_line_first > start_col) {
+ grid_line_first = start_col;
+ grid_line_last = start_col;
+ }
+ grid_line_clear_to = end_col;
+ grid_line_clear_attr = attr;
}
/// move the cursor to a position in a currently rendered line.
@@ -490,13 +511,15 @@ void grid_line_cursor_goto(int col)
void grid_line_mirror(void)
{
- if (grid_line_first >= grid_line_last) {
+ grid_line_clear_to = MAX(grid_line_last, grid_line_clear_to);
+ if (grid_line_first >= grid_line_clear_to) {
return;
}
- linebuf_mirror(&grid_line_first, &grid_line_last, grid_line_maxcol);
+ linebuf_mirror(&grid_line_first, &grid_line_last, &grid_line_clear_to, grid_line_maxcol);
+ grid_line_rl = true;
}
-void linebuf_mirror(int *firstp, int *lastp, int maxcol)
+void linebuf_mirror(int *firstp, int *lastp, int *clearp, int maxcol)
{
int first = *firstp;
int last = *lastp;
@@ -529,8 +552,9 @@ void linebuf_mirror(int *firstp, int *lastp, int maxcol)
linebuf_vcol[mirror - col] = scratch_vcol[col];
}
- *lastp = maxcol - first;
- *firstp = maxcol - last;
+ *firstp = maxcol - *clearp;
+ *clearp = maxcol - first;
+ *lastp = maxcol - last;
}
/// End a group of grid_line_puts calls and send the screen buffer to the UI layer.
@@ -538,13 +562,14 @@ void grid_line_flush(void)
{
ScreenGrid *grid = grid_line_grid;
grid_line_grid = NULL;
- assert(grid_line_last <= grid_line_maxcol);
- if (grid_line_first >= grid_line_last) {
+ grid_line_clear_to = MAX(grid_line_last, grid_line_clear_to);
+ assert(grid_line_clear_to <= grid_line_maxcol);
+ if (grid_line_first >= grid_line_clear_to) {
return;
}
grid_put_linebuf(grid, grid_line_row, grid_line_coloff, grid_line_first, grid_line_last,
- grid_line_last, false, 0, false);
+ grid_line_clear_to, grid_line_rl, grid_line_clear_attr, false);
}
/// flush grid line but only if on a valid row
@@ -565,94 +590,15 @@ void grid_line_flush_if_valid_row(void)
void grid_clear(ScreenGrid *grid, int start_row, int end_row, int start_col, int end_col, int attr)
{
- grid_fill(grid, start_row, end_row, start_col, end_col, schar_from_ascii(' '),
- schar_from_ascii(' '), attr);
-}
-
-/// Fill the grid from "start_row" to "end_row" (exclusive), from "start_col"
-/// to "end_col" (exclusive) with character "c1" in first column followed by
-/// "c2" in the other columns. Use attributes "attr".
-void grid_fill(ScreenGrid *grid, int start_row, int end_row, int start_col, int end_col, schar_T c1,
- schar_T c2, int attr)
-{
- int row_off = 0;
- int col_off = 0;
- grid_adjust(&grid, &row_off, &col_off);
- start_row += row_off;
- end_row += row_off;
- start_col += col_off;
- end_col += col_off;
-
- // safety check
- if (end_row > grid->rows) {
- end_row = grid->rows;
- }
- if (end_col > grid->cols) {
- end_col = grid->cols;
- }
-
- // nothing to do
- if (start_row >= end_row || start_col >= end_col) {
- return;
- }
-
for (int row = start_row; row < end_row; row++) {
- int dirty_first = INT_MAX;
- int dirty_last = 0;
- size_t lineoff = grid->line_offset[row];
-
- // When drawing over the right half of a double-wide char clear
- // out the left half. When drawing over the left half of a
- // double wide-char clear out the right half. Only needed in a
- // terminal.
- if (start_col > 0 && grid->chars[lineoff + (size_t)start_col] == NUL) {
- size_t off = lineoff + (size_t)start_col - 1;
- grid->chars[off] = schar_from_ascii(' ');
- grid->attrs[off] = attr;
- dirty_first = start_col - 1;
- }
- if (end_col < grid->cols && grid->chars[lineoff + (size_t)end_col] == NUL) {
- size_t off = lineoff + (size_t)end_col;
- grid->chars[off] = schar_from_ascii(' ');
- grid->attrs[off] = attr;
- dirty_last = end_col + 1;
- }
-
- int col = start_col;
- schar_T sc = c1;
- for (col = start_col; col < end_col; col++) {
- size_t off = lineoff + (size_t)col;
- if (grid->chars[off] != sc || grid->attrs[off] != attr || rdb_flags & RDB_NODELTA) {
- grid->chars[off] = sc;
- grid->attrs[off] = attr;
- if (dirty_first == INT_MAX) {
- dirty_first = col;
- }
- dirty_last = col + 1;
- }
- grid->vcols[off] = -1;
- if (col == start_col) {
- sc = c2;
- }
- }
- if (dirty_last > dirty_first) {
- if (grid->throttled) {
- // Note: assumes msg_grid is the only throttled grid
- assert(grid == &msg_grid);
- int dirty = 0;
- if (attr != HL_ATTR(HLF_MSG) || c2 != ' ') {
- dirty = dirty_last;
- } else if (c1 != ' ') {
- dirty = dirty_first + 1;
- }
- if (grid->dirty_col && dirty > grid->dirty_col[row]) {
- grid->dirty_col[row] = dirty;
- }
- } else {
- int last = c2 != ' ' ? dirty_last : dirty_first + (c1 != ' ');
- ui_line(grid, row, dirty_first, last, dirty_last, attr, false);
- }
+ grid_line_start(grid, row);
+ end_col = MIN(end_col, grid_line_maxcol);
+ if (grid_line_row >= grid_line_grid->rows || start_col >= end_col) {
+ grid_line_grid = NULL; // TODO(bfredl): make callers behave instead
+ return;
}
+ grid_line_clear_end(start_col, end_col, attr);
+ grid_line_flush();
}
}
@@ -712,19 +658,12 @@ void grid_put_linebuf(ScreenGrid *grid, int row, int coloff, int col, int endcol
col--;
}
+ int clear_start = endcol;
if (rl) {
- // Clear rest first, because it's left of the text.
- if (clear_width > 0) {
- while (col <= endcol && grid->chars[off_to + (size_t)col] == schar_from_ascii(' ')
- && grid->attrs[off_to + (size_t)col] == bg_attr) {
- col++;
- }
- if (col <= endcol) {
- grid_clear(grid, row, row + 1, col + coloff, endcol + coloff + 1, bg_attr);
- }
- }
- col = endcol + 1;
+ clear_start = col;
+ col = endcol;
endcol = clear_width;
+ clear_width = col;
}
if (p_arshape && !p_tbidi && endcol > col) {
@@ -797,45 +736,49 @@ void grid_put_linebuf(ScreenGrid *grid, int row, int coloff, int col, int endcol
end_dirty++;
}
- int clear_end = -1;
- if (clear_width > 0 && !rl) {
- // blank out the rest of the line
- // TODO(bfredl): we could cache winline widths
- while (col < clear_width) {
- size_t off = (size_t)col + off_to;
- if (grid->chars[off] != schar_from_ascii(' ')
- || grid->attrs[off] != bg_attr
- || rdb_flags & RDB_NODELTA) {
- grid->chars[off] = schar_from_ascii(' ');
- grid->attrs[off] = bg_attr;
- if (start_dirty == -1) {
- start_dirty = col;
- end_dirty = col;
- } else if (clear_end == -1) {
- end_dirty = endcol;
- }
- clear_end = col + 1;
+ int clear_dirty_start = -1, clear_end = -1;
+ // blank out the rest of the line
+ // TODO(bfredl): we could cache winline widths
+ col = clear_start;
+ while (col < clear_width) {
+ size_t off = (size_t)col + off_to;
+ if (grid->chars[off] != schar_from_ascii(' ')
+ || grid->attrs[off] != bg_attr
+ || rdb_flags & RDB_NODELTA) {
+ grid->chars[off] = schar_from_ascii(' ');
+ grid->attrs[off] = bg_attr;
+ if (clear_dirty_start == -1) {
+ clear_dirty_start = col;
}
- grid->vcols[off] = MAXCOL;
- col++;
+ clear_end = col + 1;
}
+ grid->vcols[off] = MAXCOL;
+ col++;
}
- if (clear_end < end_dirty) {
+ if (rl && start_dirty != -1 && clear_dirty_start != -1) {
+ if (grid->throttled || clear_dirty_start >= start_dirty - 5) {
+ // cannot draw now or too small to be worth a separate "clear" event
+ start_dirty = clear_dirty_start;
+ } else {
+ ui_line(grid, row, invalid_row, coloff + clear_dirty_start, coloff + clear_dirty_start,
+ coloff + clear_end, bg_attr, wrap);
+ }
clear_end = end_dirty;
+ } else {
+ if (start_dirty == -1) { // clear only
+ start_dirty = clear_dirty_start;
+ end_dirty = clear_dirty_start;
+ } else if (clear_end < end_dirty) { // put only
+ clear_end = end_dirty;
+ } else {
+ end_dirty = endcol;
+ }
}
- if (start_dirty == -1) {
- start_dirty = end_dirty;
- }
+
if (clear_end > start_dirty) {
if (!grid->throttled) {
- int start_pos = coloff + start_dirty;
- // When drawing over the right half of a double-wide char clear out the
- // left half. Only needed in a terminal.
- if (invalid_row && start_pos == 0) {
- start_pos = -1;
- }
- ui_line(grid, row, start_pos, coloff + end_dirty, coloff + clear_end,
+ ui_line(grid, row, invalid_row, coloff + start_dirty, coloff + end_dirty, coloff + clear_end,
bg_attr, wrap);
} else if (grid->dirty_col) {
// TODO(bfredl): really get rid of the extra pseudo terminal in message.c
@@ -1125,3 +1068,15 @@ win_T *get_win_by_grid_handle(handle_T handle)
}
return NULL;
}
+
+/// Put a unicode character in a screen cell.
+schar_T schar_from_char(int c)
+{
+ schar_T sc = 0;
+ if (c >= 0x200000) {
+ // TODO(bfredl): this must NEVER happen, even if the file contained overlong sequences
+ c = 0xFFFD;
+ }
+ utf_char2bytes(c, (char *)&sc);
+ return sc;
+}
diff --git a/src/nvim/grid.h b/src/nvim/grid.h
index 7398ae7847..7506f0fc9d 100644
--- a/src/nvim/grid.h
+++ b/src/nvim/grid.h
@@ -3,9 +3,8 @@
#include <stdbool.h>
#include <stddef.h> // IWYU pragma: keep
-#include "nvim/grid_defs.h" // IWYU pragma: export
+#include "nvim/grid_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
-#include "nvim/mbyte.h"
#include "nvim/pos_defs.h"
#include "nvim/types_defs.h"
@@ -41,18 +40,6 @@ EXTERN char *linebuf_scratch INIT( = NULL);
# define schar_from_ascii(x) ((schar_T)(x))
#endif
-/// Put a unicode character in a screen cell.
-static inline schar_T schar_from_char(int c)
-{
- schar_T sc = 0;
- if (c >= 0x200000) {
- // TODO(bfredl): this must NEVER happen, even if the file contained overlong sequences
- c = 0xFFFD;
- }
- utf_char2bytes(c, (char *)&sc);
- return sc;
-}
-
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "grid.h.generated.h"
#endif
diff --git a/src/nvim/hashtab.c b/src/nvim/hashtab.c
index 68365cac5b..a8a998a361 100644
--- a/src/nvim/hashtab.c
+++ b/src/nvim/hashtab.c
@@ -24,7 +24,7 @@
#include <string.h>
#include "nvim/ascii_defs.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/hashtab.h"
#include "nvim/memory.h"
#include "nvim/message.h"
diff --git a/src/nvim/hashtab.h b/src/nvim/hashtab.h
index d14eb6944e..06c73ce6c0 100644
--- a/src/nvim/hashtab.h
+++ b/src/nvim/hashtab.h
@@ -2,7 +2,7 @@
#include <stddef.h>
-#include "nvim/hashtab_defs.h" // IWYU pragma: export
+#include "nvim/hashtab_defs.h" // IWYU pragma: keep
/// Magic number used for hashitem "hi_key" value indicating a deleted item
///
diff --git a/src/nvim/help.c b/src/nvim/help.c
index ff919f2fb9..c6a6108010 100644
--- a/src/nvim/help.c
+++ b/src/nvim/help.c
@@ -8,30 +8,36 @@
#include "nvim/ascii_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand.h"
+#include "nvim/cmdexpand_defs.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/extmark_defs.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/help.h"
#include "nvim/macros_defs.h"
#include "nvim/mark.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/fs.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/runtime.h"
diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c
index cffa362d6a..bd599d686f 100644
--- a/src/nvim/highlight.c
+++ b/src/nvim/highlight.c
@@ -14,7 +14,7 @@
#include "nvim/decoration_defs.h"
#include "nvim/decoration_provider.h"
#include "nvim/drawscreen.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
#include "nvim/highlight_defs.h"
@@ -23,6 +23,7 @@
#include "nvim/macros_defs.h"
#include "nvim/map_defs.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/message.h"
#include "nvim/option.h"
#include "nvim/popupmenu.h"
diff --git a/src/nvim/highlight.h b/src/nvim/highlight.h
index 228d96ceb2..cb3a84bcaf 100644
--- a/src/nvim/highlight.h
+++ b/src/nvim/highlight.h
@@ -4,8 +4,8 @@
#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
#include "nvim/api/private/defs.h" // IWYU pragma: keep
-#include "nvim/buffer_defs.h" // IWYU pragma: keep
-#include "nvim/highlight_defs.h" // IWYU pragma: export
+#include "nvim/buffer_defs.h"
+#include "nvim/highlight_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
#include "nvim/option_vars.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c
index 71c44c852e..07ba1088f9 100644
--- a/src/nvim/highlight_group.c
+++ b/src/nvim/highlight_group.c
@@ -15,6 +15,7 @@
#include "nvim/api/private/validate.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand_defs.h"
@@ -26,7 +27,8 @@
#include "nvim/eval/vars.h"
#include "nvim/ex_docmd.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
#include "nvim/highlight_group.h"
@@ -34,14 +36,17 @@
#include "nvim/macros_defs.h"
#include "nvim/map_defs.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/message.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/os/time.h"
#include "nvim/runtime.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/vim_defs.h"
/// \addtogroup SG_SET
@@ -308,6 +313,8 @@ static const char *highlight_init_light[] = {
"Normal guifg=NvimDarkGrey2 guibg=NvimLightGrey2 ctermfg=NONE ctermbg=NONE",
// UI
+ "Added guifg=NvimDarGreen ctermfg=2",
+ "Changed guifg=NvimDarkCyan ctermfg=6",
"ColorColumn guibg=NvimLightGrey4 cterm=reverse",
"Conceal guifg=NvimLightGrey4",
"CurSearch guifg=NvimLightGrey1 guibg=NvimDarkYellow ctermfg=15 ctermbg=3",
@@ -336,6 +343,7 @@ static const char *highlight_init_light[] = {
"RedrawDebugClear guibg=NvimLightYellow ctermfg=15 ctermbg=3",
"RedrawDebugComposed guibg=NvimLightGreen ctermfg=15 ctermbg=2",
"RedrawDebugRecompose guibg=NvimLightRed ctermfg=15 ctermbg=1",
+ "Removed guifg=NvimDarkRed ctermfg=1",
"Search guifg=NvimDarkGrey1 guibg=NvimLightYellow ctermfg=15 ctermbg=3",
"SignColumn guifg=NvimLightGrey4",
"SpecialKey guifg=NvimLightGrey4",
@@ -377,6 +385,8 @@ static const char *highlight_init_dark[] = {
"Normal guifg=NvimLightGrey2 guibg=NvimDarkGrey2 ctermfg=NONE ctermbg=NONE",
// UI
+ "Added guifg=NvimLightGreen ctermfg=10",
+ "Changed guifg=NvimLightCyan ctermfg=14",
"ColorColumn guibg=NvimDarkGrey4 cterm=reverse",
"Conceal guifg=NvimDarkGrey4",
"CurSearch guifg=NvimDarkGrey1 guibg=NvimLightYellow ctermfg=0 ctermbg=11",
@@ -405,6 +415,7 @@ static const char *highlight_init_dark[] = {
"RedrawDebugClear guibg=NvimDarkYellow ctermfg=0 ctermbg=11",
"RedrawDebugComposed guibg=NvimDarkGreen ctermfg=0 ctermbg=10",
"RedrawDebugRecompose guibg=NvimDarkRed ctermfg=0 ctermbg=9",
+ "Removed guifg=NvimLightRed ctermfg=9",
"Search guifg=NvimLightGrey1 guibg=NvimDarkYellow ctermfg=0 ctermbg=11",
"SignColumn guifg=NvimDarkGrey4",
"SpecialKey guifg=NvimDarkGrey4",
diff --git a/src/nvim/indent.c b/src/nvim/indent.c
index 4022bca5ac..080f6f986a 100644
--- a/src/nvim/indent.c
+++ b/src/nvim/indent.c
@@ -7,6 +7,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/assert_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
@@ -17,23 +18,26 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/extmark.h"
-#include "nvim/gettext.h"
+#include "nvim/extmark_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
-#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/move.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/input.h"
#include "nvim/plines.h"
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/search.h"
#include "nvim/state_defs.h"
#include "nvim/strings.h"
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c
index 36223f0899..a660c9dead 100644
--- a/src/nvim/indent_c.c
+++ b/src/nvim/indent_c.c
@@ -13,7 +13,7 @@
#include "nvim/indent.h"
#include "nvim/indent_c.h"
#include "nvim/macros_defs.h"
-#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/option.h"
diff --git a/src/nvim/input.c b/src/nvim/input.c
index b5080c87a0..7e6b6d4bd0 100644
--- a/src/nvim/input.c
+++ b/src/nvim/input.c
@@ -8,9 +8,10 @@
#include "nvim/ascii_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/input.h"
#include "nvim/keycodes.h"
#include "nvim/mbyte.h"
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c
index 6162371062..08de7ac6f6 100644
--- a/src/nvim/insexpand.c
+++ b/src/nvim/insexpand.c
@@ -12,32 +12,40 @@
#include "klib/kvec.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand.h"
+#include "nvim/cmdexpand_defs.h"
#include "nvim/cursor.h"
#include "nvim/drawscreen.h"
#include "nvim/edit.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/eval/userfunc.h"
#include "nvim/ex_eval.h"
#include "nvim/ex_getln.h"
#include "nvim/extmark.h"
+#include "nvim/extmark_defs.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
#include "nvim/insexpand.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
-#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
@@ -52,9 +60,11 @@
#include "nvim/popupmenu.h"
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/search.h"
#include "nvim/spell.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/tag.h"
#include "nvim/textformat.h"
diff --git a/src/nvim/keycodes.c b/src/nvim/keycodes.c
index dd7a917380..c45ad83204 100644
--- a/src/nvim/keycodes.c
+++ b/src/nvim/keycodes.c
@@ -10,14 +10,16 @@
#include "nvim/charset.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/eval/vars.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/mouse.h"
+#include "nvim/option_vars.h"
#include "nvim/strings.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/keycodes.h b/src/nvim/keycodes.h
index 6aebad5b66..18af3f87d6 100644
--- a/src/nvim/keycodes.h
+++ b/src/nvim/keycodes.h
@@ -1,7 +1,5 @@
#pragma once
-#include <stddef.h>
-
#include "nvim/ascii_defs.h"
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/lib/queue.h b/src/nvim/lib/queue_defs.h
index 1f113a057a..1f113a057a 100644
--- a/src/nvim/lib/queue.h
+++ b/src/nvim/lib/queue_defs.h
diff --git a/src/nvim/log.c b/src/nvim/log.c
index 4370693f49..fbb3e0385a 100644
--- a/src/nvim/log.c
+++ b/src/nvim/log.c
@@ -25,6 +25,7 @@
#include "nvim/message.h"
#include "nvim/os/fs.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/stdpaths_defs.h"
#include "nvim/os/time.h"
#include "nvim/path.h"
diff --git a/src/nvim/lua/converter.c b/src/nvim/lua/converter.c
index 468fe19cf9..575dc2ce37 100644
--- a/src/nvim/lua/converter.c
+++ b/src/nvim/lua/converter.c
@@ -16,7 +16,7 @@
#include "nvim/eval/typval_defs.h"
#include "nvim/eval/typval_encode.h"
#include "nvim/eval/userfunc.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/lua/converter.h"
#include "nvim/lua/executor.h"
#include "nvim/macros_defs.h"
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index 116e8136cc..f48cab6739 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -13,6 +13,7 @@
#include "klib/kvec.h"
#include "luv/luv.h"
#include "nvim/api/extmark.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer_defs.h"
@@ -23,7 +24,9 @@
#include "nvim/eval.h"
#include "nvim/eval/funcs.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/eval/userfunc.h"
+#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/time.h"
@@ -31,8 +34,9 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_getln.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/keycodes.h"
#include "nvim/lua/converter.h"
@@ -43,22 +47,30 @@
#include "nvim/main.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/message.h"
#include "nvim/msgpack_rpc/channel.h"
#include "nvim/option_vars.h"
#include "nvim/os/fileio.h"
+#include "nvim/os/fileio_defs.h"
#include "nvim/os/os.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/profile.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/strings.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/undo.h"
#include "nvim/usercmd.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
+#ifndef MSWIN
+# include <pthread.h>
+#endif
+
static int in_fast_callback = 0;
static bool in_script = false;
diff --git a/src/nvim/lua/executor.h b/src/nvim/lua/executor.h
index 16fa5f8bc0..0b4623cbd3 100644
--- a/src/nvim/lua/executor.h
+++ b/src/nvim/lua/executor.h
@@ -9,7 +9,6 @@
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/func_attr.h"
#include "nvim/macros_defs.h"
-#include "nvim/map_defs.h"
#include "nvim/types_defs.h"
#include "nvim/usercmd.h" // IWYU pragma: keep
diff --git a/src/nvim/lua/secure.c b/src/nvim/lua/secure.c
index 65c13f8872..f62e0ace04 100644
--- a/src/nvim/lua/secure.c
+++ b/src/nvim/lua/secure.c
@@ -4,7 +4,7 @@
#include "nvim/charset.h"
#include "nvim/ex_cmds_defs.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/lua/executor.h"
#include "nvim/lua/secure.h"
diff --git a/src/nvim/lua/spell.c b/src/nvim/lua/spell.c
index e6c38ea9cb..ba83239dc5 100644
--- a/src/nvim/lua/spell.c
+++ b/src/nvim/lua/spell.c
@@ -7,7 +7,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/buffer_defs.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight_defs.h"
#include "nvim/lua/spell.h"
diff --git a/src/nvim/lua/stdlib.c b/src/nvim/lua/stdlib.c
index db710457c3..5fea1ba5d8 100644
--- a/src/nvim/lua/stdlib.c
+++ b/src/nvim/lua/stdlib.c
@@ -14,10 +14,12 @@
#include "cjson/lua_cjson.h"
#include "mpack/lmpack.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/eval/vars.h"
#include "nvim/ex_eval.h"
#include "nvim/fold.h"
@@ -29,10 +31,12 @@
#include "nvim/lua/xdiff.h"
#include "nvim/map_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/runtime.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/lua/xdiff.c b/src/nvim/lua/xdiff.c
index e21bca170f..5285c1187d 100644
--- a/src/nvim/lua/xdiff.c
+++ b/src/nvim/lua/xdiff.c
@@ -5,6 +5,7 @@
#include <string.h>
#include "luaconf.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/linematch.h"
#include "nvim/lua/converter.h"
diff --git a/src/nvim/main.c b/src/nvim/main.c
index e41501c562..6d71dc618a 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -19,13 +19,17 @@
#include "auto/config.h" // IWYU pragma: keep
#include "nvim/api/extmark.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/api/ui.h"
#include "nvim/arglist.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/channel.h"
+#include "nvim/channel_defs.h"
#include "nvim/decoration.h"
#include "nvim/decoration_provider.h"
#include "nvim/diff.h"
@@ -33,6 +37,7 @@
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/eval/userfunc.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
@@ -46,7 +51,7 @@
#include "nvim/fold.h"
#include "nvim/garray.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/hashtab.h"
@@ -70,13 +75,16 @@
#include "nvim/normal.h"
#include "nvim/ops.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/fileio.h"
+#include "nvim/os/fileio_defs.h"
#include "nvim/os/fs.h"
#include "nvim/os/input.h"
#include "nvim/os/lang.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/signal.h"
#include "nvim/os/stdpaths_defs.h"
#include "nvim/path.h"
@@ -84,6 +92,7 @@
#include "nvim/profile.h"
#include "nvim/quickfix.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/shada.h"
#include "nvim/statusline.h"
#include "nvim/strings.h"
@@ -97,10 +106,15 @@
#include "nvim/vim_defs.h"
#include "nvim/window.h"
#include "nvim/winfloat.h"
+
#ifdef MSWIN
# include "nvim/os/os_win_console.h"
#endif
+#if defined(MSWIN) && !defined(MAKE_LIB)
+# include "nvim/mbyte.h"
+#endif
+
// values for "window_layout"
enum {
WIN_HOR = 1, // "-o" horizontally split windows
diff --git a/src/nvim/map_glyph_cache.c b/src/nvim/map_glyph_cache.c
index 091b4f7990..5efa87b960 100644
--- a/src/nvim/map_glyph_cache.c
+++ b/src/nvim/map_glyph_cache.c
@@ -11,6 +11,7 @@
#include <stdlib.h>
#include <string.h>
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/macros_defs.h"
diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c
index 58fce92fb0..a8af2168c5 100644
--- a/src/nvim/mapping.c
+++ b/src/nvim/mapping.c
@@ -25,15 +25,19 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_session.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/getchar_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/keycodes.h"
#include "nvim/lua/executor.h"
#include "nvim/macros_defs.h"
#include "nvim/mapping.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option_defs.h"
@@ -47,6 +51,7 @@
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/vim_defs.h"
/// List used for abbreviations.
diff --git a/src/nvim/mapping.h b/src/nvim/mapping.h
index 3baa52ee77..b82117ea86 100644
--- a/src/nvim/mapping.h
+++ b/src/nvim/mapping.h
@@ -8,7 +8,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/mapping_defs.h" // IWYU pragma: export
+#include "nvim/mapping_defs.h" // IWYU pragma: keep
#include "nvim/option_defs.h" // IWYU pragma: keep
#include "nvim/regexp_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/mapping_defs.h b/src/nvim/mapping_defs.h
index 4f0334c226..05b8aef23a 100644
--- a/src/nvim/mapping_defs.h
+++ b/src/nvim/mapping_defs.h
@@ -3,7 +3,6 @@
#include <stdbool.h>
#include "nvim/eval/typval_defs.h"
-#include "nvim/types_defs.h"
enum { MAXMAPLEN = 50, }; ///< Maximum length of key sequence to be mapped.
diff --git a/src/nvim/mark.c b/src/nvim/mark.c
index 075c371024..34e35a8277 100644
--- a/src/nvim/mark.c
+++ b/src/nvim/mark.c
@@ -9,30 +9,35 @@
#include "nvim/ascii_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/diff.h"
#include "nvim/edit.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/extmark.h"
#include "nvim/extmark_defs.h"
#include "nvim/fold.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/mark.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/move.h"
-#include "nvim/normal.h"
+#include "nvim/normal_defs.h"
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/time.h"
+#include "nvim/os/time_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/quickfix.h"
diff --git a/src/nvim/mark.h b/src/nvim/mark.h
index 2c1bf7c73c..c3661e2e22 100644
--- a/src/nvim/mark.h
+++ b/src/nvim/mark.h
@@ -7,7 +7,7 @@
#include "nvim/extmark_defs.h" // IWYU pragma: keep
#include "nvim/func_attr.h"
#include "nvim/macros_defs.h"
-#include "nvim/mark_defs.h" // IWYU pragma: export
+#include "nvim/mark_defs.h" // IWYU pragma: keep
#include "nvim/os/time.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/mark_defs.h b/src/nvim/mark_defs.h
index bf4fc8f6ad..98bdb6ee04 100644
--- a/src/nvim/mark_defs.h
+++ b/src/nvim/mark_defs.h
@@ -2,7 +2,6 @@
#include "nvim/eval/typval_defs.h"
#include "nvim/os/time_defs.h"
-#include "nvim/pos_defs.h"
// marks: positions in a file
// (a normal mark is a lnum/col pair, the same as a file position)
diff --git a/src/nvim/marktree.c b/src/nvim/marktree.c
index fb0d0502ee..9b6b6f8345 100644
--- a/src/nvim/marktree.c
+++ b/src/nvim/marktree.c
@@ -59,6 +59,7 @@
#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#define T MT_BRANCH_FACTOR
#define ILEN (sizeof(MTNode) + (2 * T) * sizeof(void *))
diff --git a/src/nvim/marktree.h b/src/nvim/marktree.h
index 46d60a2b69..b31feaad3c 100644
--- a/src/nvim/marktree.h
+++ b/src/nvim/marktree.h
@@ -5,7 +5,7 @@
#include <stdint.h>
#include "nvim/decoration_defs.h"
-#include "nvim/marktree_defs.h" // IWYU pragma: export
+#include "nvim/marktree_defs.h" // IWYU pragma: keep
#include "nvim/pos_defs.h" // IWYU pragma: keep
// only for debug functions:
#include "nvim/api/private/defs.h" // IWYU pragma: keep
diff --git a/src/nvim/marktree_defs.h b/src/nvim/marktree_defs.h
index 8aa1b1e376..5dc901b9bd 100644
--- a/src/nvim/marktree_defs.h
+++ b/src/nvim/marktree_defs.h
@@ -4,7 +4,6 @@
#include <stddef.h>
#include <stdint.h>
-#include "klib/kvec.h"
#include "nvim/decoration_defs.h"
#include "nvim/map_defs.h"
diff --git a/src/nvim/match.c b/src/nvim/match.c
index 3e77546800..c8837969b6 100644
--- a/src/nvim/match.c
+++ b/src/nvim/match.c
@@ -16,13 +16,15 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/fold.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/macros_defs.h"
#include "nvim/match.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index 75e38c59f3..26c95c698f 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -46,9 +46,10 @@
#include "nvim/eval/typval.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/iconv_defs.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
@@ -2803,3 +2804,14 @@ char *get_encoding_name(expand_T *xp FUNC_ATTR_UNUSED, int idx)
return (char *)enc_canon_table[idx].name;
}
+
+/// Compare strings
+///
+/// @param[in] ic True if case is to be ignored.
+///
+/// @return 0 if s1 == s2, <0 if s1 < s2, >0 if s1 > s2.
+int mb_strcmp_ic(bool ic, const char *s1, const char *s2)
+ FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
+{
+ return (ic ? mb_stricmp(s1, s2) : strcmp(s1, s2));
+}
diff --git a/src/nvim/mbyte.h b/src/nvim/mbyte.h
index 96f8b24983..2fb353de9e 100644
--- a/src/nvim/mbyte.h
+++ b/src/nvim/mbyte.h
@@ -1,15 +1,12 @@
#pragma once
-#include <stdbool.h>
#include <stdint.h>
-#include <string.h>
#include <sys/types.h> // IWYU pragma: keep
#include <uv.h> // IWYU pragma: keep
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
-#include "nvim/func_attr.h"
-#include "nvim/mbyte_defs.h" // IWYU pragma: export
+#include "nvim/mbyte_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
@@ -27,18 +24,6 @@ extern const uint8_t utf8len_tab_zero[256];
extern const uint8_t utf8len_tab[256];
-static inline int mb_strcmp_ic(bool ic, const char *s1, const char *s2)
- REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE REAL_FATTR_WARN_UNUSED_RESULT;
-/// Compare strings
-///
-/// @param[in] ic True if case is to be ignored.
-///
-/// @return 0 if s1 == s2, <0 if s1 < s2, >0 if s1 > s2.
-static inline int mb_strcmp_ic(bool ic, const char *s1, const char *s2)
-{
- return (ic ? mb_stricmp(s1, s2) : strcmp(s1, s2));
-}
-
// Use our own character-case definitions, because the current locale may
// differ from what the .spl file uses.
// These must not be called with negative number!
diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c
index 8869a428d1..fb9f2eb8df 100644
--- a/src/nvim/memfile.c
+++ b/src/nvim/memfile.c
@@ -47,7 +47,7 @@
#include "nvim/assert_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/fileio.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/map_defs.h"
#include "nvim/memfile.h"
@@ -56,8 +56,9 @@
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/input.h"
-#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/memfile.h b/src/nvim/memfile.h
index 6e7b575e5b..17913e5fb2 100644
--- a/src/nvim/memfile.h
+++ b/src/nvim/memfile.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/memfile_defs.h" // IWYU pragma: export
+#include "nvim/memfile_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
/// flags for mf_sync()
diff --git a/src/nvim/memfile_defs.h b/src/nvim/memfile_defs.h
index fd8983664b..5caf13c9fb 100644
--- a/src/nvim/memfile_defs.h
+++ b/src/nvim/memfile_defs.h
@@ -5,8 +5,6 @@
#include <stdlib.h>
#include "nvim/map_defs.h"
-#include "nvim/pos_defs.h"
-#include "nvim/types_defs.h"
/// A block number.
///
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index 220e16ad99..e463f66714 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -46,7 +46,9 @@
#include "klib/kvec.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/change.h"
#include "nvim/cursor.h"
#include "nvim/drawscreen.h"
@@ -55,9 +57,10 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/fileio.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/input.h"
#include "nvim/macros_defs.h"
#include "nvim/main.h"
@@ -65,16 +68,21 @@
#include "nvim/mark.h"
#include "nvim/mbyte.h"
#include "nvim/memfile.h"
+#include "nvim/memfile_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/process.h"
#include "nvim/os/time.h"
+#include "nvim/os/time_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/spell.h"
diff --git a/src/nvim/memline.h b/src/nvim/memline.h
index 8e7f3a565c..23cbf75c19 100644
--- a/src/nvim/memline.h
+++ b/src/nvim/memline.h
@@ -2,7 +2,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
-#include "nvim/memline_defs.h" // IWYU pragma: export
+#include "nvim/memline_defs.h" // IWYU pragma: keep
#include "nvim/pos_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/memline_defs.h b/src/nvim/memline_defs.h
index 0fde56f0e6..1a217c96d4 100644
--- a/src/nvim/memline_defs.h
+++ b/src/nvim/memline_defs.h
@@ -1,6 +1,7 @@
#pragma once
#include "nvim/memfile_defs.h"
+#include "nvim/pos_defs.h"
///
/// When searching for a specific line, we remember what blocks in the tree
diff --git a/src/nvim/memory.c b/src/nvim/memory.c
index 3e43771cdf..cf584575b8 100644
--- a/src/nvim/memory.c
+++ b/src/nvim/memory.c
@@ -13,13 +13,14 @@
#include "nvim/api/ui.h"
#include "nvim/arglist.h"
#include "nvim/ascii_defs.h"
+#include "nvim/buffer_defs.h"
#include "nvim/buffer_updates.h"
#include "nvim/channel.h"
#include "nvim/context.h"
#include "nvim/decoration_provider.h"
#include "nvim/drawline.h"
#include "nvim/eval.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
#include "nvim/highlight_group.h"
diff --git a/src/nvim/memory.h b/src/nvim/memory.h
index 1511876c81..5aafeb1260 100644
--- a/src/nvim/memory.h
+++ b/src/nvim/memory.h
@@ -2,12 +2,12 @@
#include <stdbool.h>
#include <stdint.h> // IWYU pragma: keep
-#include <string.h> // IWYU pragma: keep
+#include <string.h>
#include <time.h> // IWYU pragma: keep
#include "auto/config.h"
#include "nvim/macros_defs.h"
-#include "nvim/memory_defs.h" // IWYU pragma: export
+#include "nvim/memory_defs.h" // IWYU pragma: keep
/// `malloc()` function signature
typedef void *(*MemMalloc)(size_t);
diff --git a/src/nvim/menu.c b/src/nvim/menu.c
index b61c28a4df..4ca2a61ab1 100644
--- a/src/nvim/menu.c
+++ b/src/nvim/menu.c
@@ -8,22 +8,28 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand_defs.h"
#include "nvim/cursor.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/getchar_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memory.h"
#include "nvim/menu.h"
#include "nvim/menu_defs.h"
@@ -32,6 +38,7 @@
#include "nvim/popupmenu.h"
#include "nvim/pos_defs.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
diff --git a/src/nvim/menu.h b/src/nvim/menu.h
index 9644386003..08f5601ca3 100644
--- a/src/nvim/menu.h
+++ b/src/nvim/menu.h
@@ -2,7 +2,7 @@
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
-#include "nvim/menu_defs.h" // IWYU pragma: export
+#include "nvim/menu_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 2b668db7cd..9dd83d6c02 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -11,6 +11,7 @@
#include <uv.h>
#include "klib/kvec.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer_defs.h"
@@ -19,23 +20,28 @@
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
+#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_eval.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/indent.h"
#include "nvim/input.h"
#include "nvim/keycodes.h"
#include "nvim/log.h"
#include "nvim/main.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/mouse.h"
@@ -49,11 +55,13 @@
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
#include "nvim/ui_compositor.h"
+#include "nvim/ui_defs.h"
#include "nvim/vim_defs.h"
// To be able to scroll back at the "more" and "hit-enter" prompts we need to
@@ -204,6 +212,7 @@ void msg_grid_validate(void)
} else if (msg_grid.chars && !msg_scrolled && msg_grid_pos != max_rows) {
msg_grid_set_pos(max_rows, false);
}
+ msg_grid_adj.cols = Columns;
if (msg_grid.chars && !msg_scrolled && cmdline_row < msg_grid_pos) {
// TODO(bfredl): this should already be the case, but fails in some
@@ -2349,7 +2358,7 @@ void msg_scroll_flush(void)
for (int i = MAX(Rows - MAX(delta, 1), 0); i < Rows; i++) {
int row = i - msg_grid_pos;
assert(row >= 0);
- ui_line(&msg_grid, row, 0, msg_grid.dirty_col[row], msg_grid.cols,
+ ui_line(&msg_grid, row, false, 0, msg_grid.dirty_col[row], msg_grid.cols,
HL_ATTR(HLF_MSG), false);
msg_grid.dirty_col[row] = 0;
}
diff --git a/src/nvim/message.h b/src/nvim/message.h
index 66165a3263..c11c33c039 100644
--- a/src/nvim/message.h
+++ b/src/nvim/message.h
@@ -3,12 +3,11 @@
#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
+#include "nvim/message_defs.h" // IWYU pragma: keep
/// Types of dialogs passed to do_dialog().
enum {
diff --git a/src/nvim/message_defs.h b/src/nvim/message_defs.h
index 67e037fc0f..e60e60b3be 100644
--- a/src/nvim/message_defs.h
+++ b/src/nvim/message_defs.h
@@ -2,10 +2,7 @@
#include <stdbool.h>
-#include "klib/kvec.h"
#include "nvim/api/private/defs.h"
-#include "nvim/grid_defs.h"
-#include "nvim/macros_defs.h"
typedef struct {
String text;
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c
index eeec4e4cd9..a6da7dd3c7 100644
--- a/src/nvim/mouse.c
+++ b/src/nvim/mouse.c
@@ -6,6 +6,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/drawscreen.h"
@@ -17,9 +18,10 @@
#include "nvim/getchar.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
-#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
@@ -36,7 +38,9 @@
#include "nvim/pos_defs.h"
#include "nvim/search.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/statusline.h"
+#include "nvim/statusline_defs.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
diff --git a/src/nvim/move.c b/src/nvim/move.c
index d23b57823e..a7380577c4 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -15,6 +15,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/cursor.h"
#include "nvim/diff.h"
#include "nvim/drawscreen.h"
@@ -23,12 +24,13 @@
#include "nvim/eval/window.h"
#include "nvim/fold.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/macros_defs.h"
-#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/message.h"
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
index f1b7f8026e..286bb8098a 100644
--- a/src/nvim/msgpack_rpc/channel.c
+++ b/src/nvim/msgpack_rpc/channel.c
@@ -14,6 +14,7 @@
#include "nvim/api/private/helpers.h"
#include "nvim/api/ui.h"
#include "nvim/channel.h"
+#include "nvim/channel_defs.h"
#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
@@ -32,6 +33,7 @@
#include "nvim/msgpack_rpc/unpacker.h"
#include "nvim/os/input.h"
#include "nvim/rbuffer.h"
+#include "nvim/rbuffer_defs.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
#include "nvim/ui_client.h"
diff --git a/src/nvim/msgpack_rpc/channel.h b/src/nvim/msgpack_rpc/channel.h
index a33081eadc..ff73a2fc53 100644
--- a/src/nvim/msgpack_rpc/channel.h
+++ b/src/nvim/msgpack_rpc/channel.h
@@ -6,7 +6,7 @@
#include "nvim/event/defs.h"
#include "nvim/macros_defs.h"
#include "nvim/memory_defs.h" // IWYU pragma: keep
-#include "nvim/msgpack_rpc/channel_defs.h" // IWYU pragma: export
+#include "nvim/msgpack_rpc/channel_defs.h" // IWYU pragma: keep
#define METHOD_MAXLEN 512
diff --git a/src/nvim/msgpack_rpc/channel_defs.h b/src/nvim/msgpack_rpc/channel_defs.h
index 20b8a89afb..56dbb332e0 100644
--- a/src/nvim/msgpack_rpc/channel_defs.h
+++ b/src/nvim/msgpack_rpc/channel_defs.h
@@ -4,11 +4,7 @@
#include <stdbool.h>
#include <uv.h>
-#include "klib/kvec.h"
-#include "nvim/api/private/defs.h"
#include "nvim/api/private/dispatch.h"
-#include "nvim/event/process.h"
-#include "nvim/event/socket.h"
#include "nvim/map_defs.h"
typedef struct Channel Channel;
diff --git a/src/nvim/msgpack_rpc/server.c b/src/nvim/msgpack_rpc/server.c
index e60c1b88a5..56b03d67d0 100644
--- a/src/nvim/msgpack_rpc/server.c
+++ b/src/nvim/msgpack_rpc/server.c
@@ -6,8 +6,10 @@
#include "nvim/channel.h"
#include "nvim/eval.h"
+#include "nvim/event/defs.h"
#include "nvim/event/socket.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/log.h"
#include "nvim/main.h"
#include "nvim/memory.h"
diff --git a/src/nvim/msgpack_rpc/unpacker.h b/src/nvim/msgpack_rpc/unpacker.h
index d43dc2e997..022d778013 100644
--- a/src/nvim/msgpack_rpc/unpacker.h
+++ b/src/nvim/msgpack_rpc/unpacker.h
@@ -5,12 +5,13 @@
#include "mpack/mpack_core.h"
#include "mpack/object.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/dispatch.h"
#include "nvim/grid_defs.h"
#include "nvim/memory_defs.h"
#include "nvim/msgpack_rpc/channel_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h"
-#include "nvim/ui_client.h"
+#include "nvim/ui_defs.h"
struct Unpacker {
mpack_parser_t parser;
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 42ae7519c1..ed2b1437ec 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -17,7 +17,9 @@
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cmdhist.h"
@@ -34,17 +36,20 @@
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/help.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
#include "nvim/mapping.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
+#include "nvim/memline_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/mouse.h"
@@ -60,9 +65,11 @@
#include "nvim/quickfix.h"
#include "nvim/search.h"
#include "nvim/spell.h"
+#include "nvim/spell_defs.h"
#include "nvim/spellfile.h"
#include "nvim/spellsuggest.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/statusline.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
@@ -71,6 +78,7 @@
#include "nvim/textobject.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/undo.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
diff --git a/src/nvim/normal.h b/src/nvim/normal.h
index 93e3e09c2e..57a3418d92 100644
--- a/src/nvim/normal.h
+++ b/src/nvim/normal.h
@@ -3,7 +3,7 @@
#include <stddef.h> // IWYU pragma: keep
#include "nvim/macros_defs.h"
-#include "nvim/normal_defs.h" // IWYU pragma: export
+#include "nvim/normal_defs.h" // IWYU pragma: keep
#include "nvim/pos_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 5a83d7d247..8386dcaec6 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -15,7 +15,9 @@
#include "nvim/ascii_defs.h"
#include "nvim/assert_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
@@ -29,17 +31,22 @@
#include "nvim/extmark.h"
#include "nvim/fold.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/getchar_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
+#include "nvim/memline_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/mouse.h"
@@ -54,11 +61,13 @@
#include "nvim/plines.h"
#include "nvim/search.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/terminal.h"
#include "nvim/textformat.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/undo.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 1561361771..68ddb95e38 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -30,8 +30,11 @@
#include "nvim/api/private/helpers.h"
#include "nvim/api/private/validate.h"
#include "nvim/ascii_defs.h"
+#include "nvim/assert_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand.h"
@@ -51,9 +54,11 @@
#include "nvim/ex_session.h"
#include "nvim/fold.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
@@ -63,6 +68,7 @@
#include "nvim/lua/executor.h"
#include "nvim/macros_defs.h"
#include "nvim/mapping.h"
+#include "nvim/math.h"
#include "nvim/mbyte.h"
#include "nvim/memfile.h"
#include "nvim/memline.h"
@@ -79,10 +85,12 @@
#include "nvim/os/input.h"
#include "nvim/os/lang.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/popupmenu.h"
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/runtime.h"
#include "nvim/search.h"
#include "nvim/spell.h"
@@ -94,7 +102,9 @@
#include "nvim/terminal.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/undo.h"
+#include "nvim/undo_defs.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
@@ -6399,3 +6409,24 @@ static Dictionary vimoption2dict(vimoption_T *opt, int req_scope, buf_T *buf, wi
return dict;
}
+
+/// Check if option is multitype (supports multiple types).
+static bool option_is_multitype(OptIndex opt_idx)
+{
+ const OptTypeFlags type_flags = get_option(opt_idx)->type_flags;
+ assert(type_flags != 0);
+ return !is_power_of_two(type_flags);
+}
+
+/// Check if option supports a specific type.
+bool option_has_type(OptIndex opt_idx, OptValType type)
+{
+ // Ensure that type flags variable can hold all types.
+ STATIC_ASSERT(kOptValTypeSize <= sizeof(OptTypeFlags) * 8,
+ "Option type_flags cannot fit all option types");
+ // Ensure that the type is valid before accessing type_flags.
+ assert(type > kOptValTypeNil && type < kOptValTypeSize);
+ // Bitshift 1 by the value of type to get the type's corresponding flag, and check if it's set in
+ // the type_flags bit field.
+ return get_option(opt_idx)->type_flags & (1 << type);
+}
diff --git a/src/nvim/option.h b/src/nvim/option.h
index f122d5c344..061c09d0ed 100644
--- a/src/nvim/option.h
+++ b/src/nvim/option.h
@@ -1,19 +1,16 @@
#pragma once
-#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h> // IWYU pragma: keep
#include "nvim/api/private/defs.h" // IWYU pragma: keep
#include "nvim/api/private/helpers.h"
-#include "nvim/assert_defs.h"
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
-#include "nvim/math.h"
-#include "nvim/option_defs.h" // IWYU pragma: export
+#include "nvim/option_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
/// The options that are local to a window or buffer have "indir" set to one of
@@ -126,24 +123,3 @@ static inline const char *optval_type_get_name(const OptValType type)
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "option.h.generated.h"
#endif
-
-/// Check if option supports a specific type.
-static inline bool option_has_type(OptIndex opt_idx, OptValType type)
-{
- // Ensure that type flags variable can hold all types.
- STATIC_ASSERT(kOptValTypeSize <= sizeof(OptTypeFlags) * 8,
- "Option type_flags cannot fit all option types");
- // Ensure that the type is valid before accessing type_flags.
- assert(type > kOptValTypeNil && type < kOptValTypeSize);
- // Bitshift 1 by the value of type to get the type's corresponding flag, and check if it's set in
- // the type_flags bit field.
- return get_option(opt_idx)->type_flags & (1 << type);
-}
-
-/// Check if option is multitype (supports multiple types).
-static inline bool option_is_multitype(OptIndex opt_idx)
-{
- const OptTypeFlags type_flags = get_option(opt_idx)->type_flags;
- assert(type_flags != 0);
- return !is_power_of_two(type_flags);
-}
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index f8f01dd993..ae9ccd371c 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -6,7 +6,6 @@
#include "nvim/api/private/defs.h"
#include "nvim/cmdexpand_defs.h"
#include "nvim/regexp_defs.h"
-#include "nvim/types_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "options_enum.generated.h"
diff --git a/src/nvim/option_vars.h b/src/nvim/option_vars.h
index 43664807cb..3dc82f8fdf 100644
--- a/src/nvim/option_vars.h
+++ b/src/nvim/option_vars.h
@@ -1,6 +1,7 @@
#pragma once
#include "nvim/macros_defs.h"
+#include "nvim/os/os_defs.h"
#include "nvim/sign_defs.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c
index 3930e53a90..cef9443e63 100644
--- a/src/nvim/optionstr.c
+++ b/src/nvim/optionstr.c
@@ -19,7 +19,7 @@
#include "nvim/eval/vars.h"
#include "nvim/ex_getln.h"
#include "nvim/fold.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/highlight_group.h"
@@ -39,6 +39,7 @@
#include "nvim/os/os.h"
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/spell.h"
#include "nvim/spellfile.h"
#include "nvim/spellsuggest.h"
diff --git a/src/nvim/os/dl.c b/src/nvim/os/dl.c
index 1a8d847f79..c6982e4fa8 100644
--- a/src/nvim/os/dl.c
+++ b/src/nvim/os/dl.c
@@ -5,7 +5,7 @@
#include <stdint.h>
#include <uv.h>
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/os/dl.h"
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index 6b4db8814c..cdfaf7580b 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -13,8 +13,9 @@
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand.h"
+#include "nvim/cmdexpand_defs.h"
#include "nvim/eval.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/log.h"
#include "nvim/macros_defs.h"
@@ -24,6 +25,7 @@
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c
index 79d6ac08e7..0141db7553 100644
--- a/src/nvim/os/fileio.c
+++ b/src/nvim/os/fileio.c
@@ -12,7 +12,7 @@
#include <uv.h>
#include "auto/config.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/log.h"
#include "nvim/macros_defs.h"
@@ -22,6 +22,7 @@
#include "nvim/os/fs.h"
#include "nvim/os/os_defs.h"
#include "nvim/rbuffer.h"
+#include "nvim/rbuffer_defs.h"
#include "nvim/types_defs.h"
#ifdef MSWIN
diff --git a/src/nvim/os/fileio.h b/src/nvim/os/fileio.h
index 55f213f377..e8fd2209db 100644
--- a/src/nvim/os/fileio.h
+++ b/src/nvim/os/fileio.h
@@ -2,7 +2,7 @@
#include <stddef.h> // IWYU pragma: keep
-#include "nvim/os/fileio_defs.h" // IWYU pragma: export
+#include "nvim/os/fileio_defs.h" // IWYU pragma: keep
/// file_open() flags
typedef enum {
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index a8c7fcc38f..09203990bb 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -18,6 +18,7 @@
#include "auto/config.h"
#include "nvim/os/fs.h"
+#include "nvim/os/os_defs.h"
#if defined(HAVE_ACL)
# ifdef HAVE_SYS_ACL_H
@@ -33,7 +34,7 @@
#endif
#include "nvim/ascii_defs.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/log.h"
#include "nvim/macros_defs.h"
diff --git a/src/nvim/os/fs.h b/src/nvim/os/fs.h
index 56dd657f70..19cdb09c99 100644
--- a/src/nvim/os/fs.h
+++ b/src/nvim/os/fs.h
@@ -5,7 +5,7 @@
#include <stdio.h> // IWYU pragma: keep
#include <uv.h> // IWYU pragma: keep
-#include "nvim/os/fs_defs.h" // IWYU pragma: export
+#include "nvim/os/fs_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c
index 0aa11beb6d..abba49f0e8 100644
--- a/src/nvim/os/input.c
+++ b/src/nvim/os/input.c
@@ -8,13 +8,14 @@
#include "nvim/api/private/defs.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/rstream.h"
#include "nvim/event/stream.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/keycodes.h"
#include "nvim/log.h"
@@ -27,7 +28,9 @@
#include "nvim/os/time.h"
#include "nvim/profile.h"
#include "nvim/rbuffer.h"
+#include "nvim/rbuffer_defs.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#define READ_BUFFER_SIZE 0xfff
#define INPUT_BUFFER_SIZE (READ_BUFFER_SIZE * 4)
diff --git a/src/nvim/os/lang.c b/src/nvim/os/lang.c
index 617ce4d3ea..f1e23fa543 100644
--- a/src/nvim/os/lang.c
+++ b/src/nvim/os/lang.c
@@ -19,7 +19,7 @@
#include "nvim/eval.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/macros_defs.h"
#include "nvim/memory.h"
diff --git a/src/nvim/os/os.h b/src/nvim/os/os.h
index 73fcd4ea7b..1a942d062b 100644
--- a/src/nvim/os/os.h
+++ b/src/nvim/os/os.h
@@ -1,14 +1,14 @@
#pragma once
-#include <stddef.h> // IWYU pragma: keep
-#include <stdint.h> // IWYU pragma: keep
-#include <uv.h> // IWYU pragma: keep
+#include <stddef.h>
+#include <stdint.h>
+#include <uv.h>
-#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
-#include "nvim/garray_defs.h" // IWYU pragma: keep
-#include "nvim/os/os_defs.h" // IWYU pragma: export
-#include "nvim/os/stdpaths_defs.h" // IWYU pragma: keep
-#include "nvim/types_defs.h" // IWYU pragma: keep
+#include "nvim/cmdexpand_defs.h"
+#include "nvim/garray_defs.h"
+#include "nvim/os/os_defs.h"
+#include "nvim/os/stdpaths_defs.h"
+#include "nvim/types_defs.h"
extern char *default_vim_dir;
extern char *default_vimruntime_dir;
diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c
index 1bdbb094bd..4d34e8fac4 100644
--- a/src/nvim/os/pty_process_unix.c
+++ b/src/nvim/os/pty_process_unix.c
@@ -32,6 +32,7 @@
#include "auto/config.h"
#include "klib/klist.h"
#include "nvim/eval/typval.h"
+#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/process.h"
#include "nvim/log.h"
@@ -39,6 +40,7 @@
#include "nvim/os/os_defs.h"
#include "nvim/os/pty_process.h"
#include "nvim/os/pty_process_unix.h"
+#include "nvim/types_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "os/pty_process_unix.c.generated.h"
@@ -403,3 +405,13 @@ static void chld_handler(uv_signal_t *handle, int signum)
proc->internal_exit_cb(proc);
}
}
+
+PtyProcess pty_process_init(Loop *loop, void *data)
+{
+ PtyProcess rv;
+ rv.process = process_init(loop, kProcessTypePty, data);
+ rv.width = 80;
+ rv.height = 24;
+ rv.tty_fd = -1;
+ return rv;
+}
diff --git a/src/nvim/os/pty_process_unix.h b/src/nvim/os/pty_process_unix.h
index 05603c8e53..1a77ae5fd5 100644
--- a/src/nvim/os/pty_process_unix.h
+++ b/src/nvim/os/pty_process_unix.h
@@ -4,8 +4,7 @@
#include <stdint.h>
#include <sys/ioctl.h>
-#include "nvim/event/process.h"
-#include "nvim/types_defs.h"
+#include "nvim/event/defs.h"
typedef struct {
Process process;
@@ -14,16 +13,6 @@ typedef struct {
int tty_fd;
} PtyProcess;
-static inline PtyProcess pty_process_init(Loop *loop, void *data)
-{
- PtyProcess rv;
- rv.process = process_init(loop, kProcessTypePty, data);
- rv.width = 80;
- rv.height = 24;
- rv.tty_fd = -1;
- return rv;
-}
-
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "os/pty_process_unix.h.generated.h"
#endif
diff --git a/src/nvim/os/pty_process_win.c b/src/nvim/os/pty_process_win.c
index e898879729..06ffb5694c 100644
--- a/src/nvim/os/pty_process_win.c
+++ b/src/nvim/os/pty_process_win.c
@@ -409,3 +409,15 @@ cleanup:
return rc;
}
+
+PtyProcess pty_process_init(Loop *loop, void *data)
+{
+ PtyProcess rv;
+ rv.process = process_init(loop, kProcessTypePty, data);
+ rv.width = 80;
+ rv.height = 24;
+ rv.conpty = NULL;
+ rv.finish_wait = NULL;
+ rv.process_handle = NULL;
+ return rv;
+}
diff --git a/src/nvim/os/pty_process_win.h b/src/nvim/os/pty_process_win.h
index 26cf387e54..3528f6bfe5 100644
--- a/src/nvim/os/pty_process_win.h
+++ b/src/nvim/os/pty_process_win.h
@@ -4,7 +4,7 @@
#include <uv.h>
#include "nvim/event/process.h"
-#include "nvim/lib/queue.h"
+#include "nvim/lib/queue_defs.h"
#include "nvim/os/pty_conpty_win.h"
typedef struct pty_process {
@@ -22,18 +22,6 @@ typedef struct arg_node {
QUEUE node; // QUEUE structure.
} ArgNode;
-static inline PtyProcess pty_process_init(Loop *loop, void *data)
-{
- PtyProcess rv;
- rv.process = process_init(loop, kProcessTypePty, data);
- rv.width = 80;
- rv.height = 24;
- rv.conpty = NULL;
- rv.finish_wait = NULL;
- rv.process_handle = NULL;
- return rv;
-}
-
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "os/pty_process_win.h.generated.h"
#endif
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index 8f541a829d..46ba13c4cd 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -12,6 +12,7 @@
#include "nvim/charset.h"
#include "nvim/eval.h"
#include "nvim/eval/typval_defs.h"
+#include "nvim/event/defs.h"
#include "nvim/event/libuv_process.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
@@ -21,7 +22,7 @@
#include "nvim/event/wstream.h"
#include "nvim/ex_cmds.h"
#include "nvim/fileio.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/macros_defs.h"
#include "nvim/main.h"
@@ -39,6 +40,7 @@
#include "nvim/pos_defs.h"
#include "nvim/profile.h"
#include "nvim/rbuffer.h"
+#include "nvim/rbuffer_defs.h"
#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/tag.h"
diff --git a/src/nvim/os/signal.c b/src/nvim/os/signal.c
index 0cbedc7330..ecedf144e5 100644
--- a/src/nvim/os/signal.c
+++ b/src/nvim/os/signal.c
@@ -7,8 +7,10 @@
#endif
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/eval.h"
+#include "nvim/event/defs.h"
#include "nvim/event/signal.h"
#include "nvim/globals.h"
#include "nvim/log.h"
diff --git a/src/nvim/os/time.c b/src/nvim/os/time.c
index b2a402f559..16118028b4 100644
--- a/src/nvim/os/time.c
+++ b/src/nvim/os/time.c
@@ -9,7 +9,7 @@
#include "auto/config.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/log.h"
#include "nvim/main.h"
diff --git a/src/nvim/os/time.h b/src/nvim/os/time.h
index 2748ba6953..b4d82d8002 100644
--- a/src/nvim/os/time.h
+++ b/src/nvim/os/time.h
@@ -3,7 +3,7 @@
#include <stddef.h> // IWYU pragma: keep
#include <time.h> // IWYU pragma: keep
-#include "nvim/os/time_defs.h" // IWYU pragma: export
+#include "nvim/os/time_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "os/time.h.generated.h"
diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c
index b9657beb7a..8886d6068d 100644
--- a/src/nvim/os/users.c
+++ b/src/nvim/os/users.c
@@ -9,8 +9,10 @@
#include "nvim/ascii_defs.h"
#include "nvim/cmdexpand_defs.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/memory.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/vim_defs.h"
#ifdef HAVE_PWD_FUNCS
# include <pwd.h>
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 5ec0709521..4de18c7530 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -17,20 +17,24 @@
#include "nvim/file_search.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/shell.h"
#include "nvim/path.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/strings.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
diff --git a/src/nvim/plines.c b/src/nvim/plines.c
index 2649977133..c2cf3796a7 100644
--- a/src/nvim/plines.c
+++ b/src/nvim/plines.c
@@ -9,12 +9,13 @@
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/diff.h"
#include "nvim/fold.h"
#include "nvim/globals.h"
#include "nvim/indent.h"
#include "nvim/macros_defs.h"
-#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/marktree.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
@@ -24,6 +25,7 @@
#include "nvim/plines.h"
#include "nvim/pos_defs.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/types_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c
index 220214c887..0350ff6928 100644
--- a/src/nvim/popupmenu.c
+++ b/src/nvim/popupmenu.c
@@ -6,29 +6,35 @@
#include <stdbool.h>
#include <string.h>
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/api/vim.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/drawscreen.h"
#include "nvim/eval/typval.h"
#include "nvim/ex_cmds.h"
+#include "nvim/ex_cmds_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/insexpand.h"
#include "nvim/keycodes.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/menu.h"
#include "nvim/message.h"
#include "nvim/move.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/plines.h"
@@ -39,6 +45,7 @@
#include "nvim/types_defs.h"
#include "nvim/ui.h"
#include "nvim/ui_compositor.h"
+#include "nvim/ui_defs.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
#include "nvim/winfloat.h"
diff --git a/src/nvim/profile.c b/src/nvim/profile.c
index 685497a9e3..f7776ef74f 100644
--- a/src/nvim/profile.c
+++ b/src/nvim/profile.c
@@ -16,9 +16,10 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
+#include "nvim/hashtab_defs.h"
#include "nvim/keycodes.h"
#include "nvim/memory.h"
#include "nvim/message.h"
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 6dc45cffcf..3ae3807937 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -13,6 +13,7 @@
#include "nvim/arglist.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
@@ -27,19 +28,24 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
+#include "nvim/ex_eval_defs.h"
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/help.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/macros_defs.h"
#include "nvim/mark.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
+#include "nvim/memline_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/move.h"
@@ -49,12 +55,15 @@
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/quickfix.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/search.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/rbuffer.h b/src/nvim/rbuffer.h
index 9ec1b1130c..942e1f2365 100644
--- a/src/nvim/rbuffer.h
+++ b/src/nvim/rbuffer.h
@@ -16,7 +16,7 @@
#include <stddef.h>
#include <stdint.h>
-#include "nvim/rbuffer_defs.h" // IWYU pragma: export
+#include "nvim/rbuffer_defs.h" // IWYU pragma: keep
// Macros that simplify working with the read/write pointers directly by hiding
// ring buffer wrap logic. Some examples:
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 088f3bda70..74f3b3452b 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -22,12 +22,15 @@
#include "nvim/eval/typval.h"
#include "nvim/eval/userfunc.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
@@ -137,7 +140,9 @@ struct regengine {
int (*regexec_nl)(regmatch_T *, uint8_t *, colnr_T, bool);
/// bt_regexec_mult or nfa_regexec_mult
int (*regexec_multi)(regmmatch_T *, win_T *, buf_T *, linenr_T, colnr_T, proftime_T *, int *);
- // uint8_t *expr;
+#ifdef REGEXP_DEBUG
+ uint8_t *expr;
+#endif
};
// Structure used to save the current input state, when it needs to be
@@ -6423,15 +6428,33 @@ static bool regmatch(uint8_t *scan, const proftime_T *tm, int *timed_out)
break;
case ANYOF:
- case ANYBUT:
+ case ANYBUT: {
+ uint8_t *q = OPERAND(scan);
+
if (c == NUL) {
status = RA_NOMATCH;
- } else if ((cstrchr((char *)OPERAND(scan), c) == NULL) == (op == ANYOF)) {
+ } else if ((cstrchr((char *)q, c) == NULL) == (op == ANYOF)) {
status = RA_NOMATCH;
- } else {
- ADVANCE_REGINPUT();
+ } else { // Check following combining characters
+ int len = utfc_ptr2len((char *)q) - utf_ptr2len((char *)q);
+
+ rex.input += utf_ptr2len((char *)rex.input);
+ q += utf_ptr2len((char *)q);
+
+ if (len == 0) {
+ break;
+ }
+
+ for (int i = 0; i < len; i++) {
+ if (q[i] != rex.input[i]) {
+ status = RA_NOMATCH;
+ break;
+ }
+ }
+ rex.input += len;
}
break;
+ }
case MULTIBYTECODE: {
int i, len;
@@ -10445,13 +10468,39 @@ collection:
} else {
if (got_coll_char == true && startc == 0) {
EMIT(0x0a);
+ EMIT(NFA_CONCAT);
} else {
EMIT(startc);
+ if (utf_ptr2len(regparse) == utfc_ptr2len(regparse)) {
+ EMIT(NFA_CONCAT);
+ }
}
- EMIT(NFA_CONCAT);
}
}
+ int plen;
+ if (utf_ptr2len(regparse) != (plen = utfc_ptr2len(regparse))) {
+ int i = utf_ptr2len(regparse);
+
+ c = utf_ptr2char(regparse + i);
+
+ // Add composing characters
+ while (true) {
+ if (c == 0) {
+ // \x00 is translated to \x0a, start at \x01.
+ EMIT(1);
+ } else {
+ EMIT(c);
+ }
+ EMIT(NFA_CONCAT);
+ if ((i += utf_char2len(c)) >= plen) {
+ break;
+ }
+ c = utf_ptr2char(regparse + i);
+ }
+ EMIT(NFA_COMPOSING);
+ EMIT(NFA_CONCAT);
+ }
MB_PTR_ADV(regparse);
} // while (p < endp)
@@ -14500,6 +14549,78 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm
state = t->state->out;
result_if_matched = (t->state->c == NFA_START_COLL);
while (true) {
+ if (state->c == NFA_COMPOSING) {
+ int mc = curc;
+ int len = 0;
+ nfa_state_T *end;
+ nfa_state_T *sta;
+ int cchars[MAX_MCO];
+ int ccount = 0;
+ int j;
+
+ sta = t->state->out->out;
+ if (utf_iscomposing(sta->c)) {
+ // Only match composing character(s), ignore base
+ // character. Used for ".{composing}" and "{composing}"
+ // (no preceding character).
+ len += utf_char2len(mc);
+ }
+ if (rex.reg_icombine && len == 0) {
+ // If \Z was present, then ignore composing characters.
+ // When ignoring the base character this always matches.
+ if (sta->c != curc) {
+ result = FAIL;
+ } else {
+ result = OK;
+ }
+ while (sta->c != NFA_END_COMPOSING) {
+ sta = sta->out;
+ }
+ }
+ // Check base character matches first, unless ignored.
+ else if (len > 0 || mc == sta->c) {
+ if (len == 0) {
+ len += utf_char2len(mc);
+ sta = sta->out;
+ }
+
+ // We don't care about the order of composing characters.
+ // Get them into cchars[] first.
+ while (len < clen) {
+ mc = utf_ptr2char((char *)rex.input + len);
+ cchars[ccount++] = mc;
+ len += utf_char2len(mc);
+ if (ccount == MAX_MCO) {
+ break;
+ }
+ }
+
+ // Check that each composing char in the pattern matches a
+ // composing char in the text. We do not check if all
+ // composing chars are matched.
+ result = OK;
+ while (sta->c != NFA_END_COMPOSING) {
+ for (j = 0; j < ccount; j++) {
+ if (cchars[j] == sta->c) {
+ break;
+ }
+ }
+ if (j == ccount) {
+ result = FAIL;
+ break;
+ }
+ sta = sta->out;
+ }
+ } else {
+ result = FAIL;
+ }
+
+ if (t->state->out->out1->c == NFA_END_COMPOSING) {
+ end = t->state->out->out1;
+ ADD_STATE_IF_MATCH(end);
+ }
+ break;
+ }
if (state->c == NFA_END_COLL) {
result = !result_if_matched;
break;
@@ -15642,6 +15763,9 @@ static regengine_T bt_regengine = {
bt_regfree,
bt_regexec_nl,
bt_regexec_multi,
+#ifdef REGEXP_DEBUG
+ "",
+#endif
};
static regengine_T nfa_regengine = {
@@ -15649,6 +15773,9 @@ static regengine_T nfa_regengine = {
nfa_regfree,
nfa_regexec_nl,
nfa_regexec_multi,
+#ifdef REGEXP_DEBUG
+ "",
+#endif
};
// Which regexp engine to use? Needed for vim_regcomp().
diff --git a/src/nvim/regexp.h b/src/nvim/regexp.h
index 1414749c2f..de4e5ded9c 100644
--- a/src/nvim/regexp.h
+++ b/src/nvim/regexp.h
@@ -2,7 +2,7 @@
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
#include "nvim/pos_defs.h" // IWYU pragma: keep
-#include "nvim/regexp_defs.h" // IWYU pragma: export
+#include "nvim/regexp_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
// Second argument for vim_regcomp().
diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c
index 11868ac447..3f8e467118 100644
--- a/src/nvim/runtime.c
+++ b/src/nvim/runtime.c
@@ -17,6 +17,7 @@
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand.h"
@@ -27,15 +28,18 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
+#include "nvim/ex_eval_defs.h"
#include "nvim/garray.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
+#include "nvim/hashtab_defs.h"
#include "nvim/lua/executor.h"
#include "nvim/macros_defs.h"
#include "nvim/map_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
@@ -45,11 +49,13 @@
#include "nvim/os/fs.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/stdpaths_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/profile.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/runtime.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/runtime.h b/src/nvim/runtime.h
index 87e4436618..7312b62526 100644
--- a/src/nvim/runtime.h
+++ b/src/nvim/runtime.h
@@ -9,7 +9,7 @@
#include "nvim/garray_defs.h"
#include "nvim/option_defs.h" // IWYU pragma: keep
#include "nvim/pos_defs.h" // IWYU pragma: keep
-#include "nvim/runtime_defs.h" // IWYU pragma: export
+#include "nvim/runtime_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
/// Stack of execution contexts. Each entry is an estack_T.
diff --git a/src/nvim/runtime_defs.h b/src/nvim/runtime_defs.h
index 169cadfb94..7029e8be66 100644
--- a/src/nvim/runtime_defs.h
+++ b/src/nvim/runtime_defs.h
@@ -3,11 +3,6 @@
#include <stdbool.h>
#include "nvim/autocmd_defs.h"
-#include "nvim/eval/typval_defs.h"
-#include "nvim/ex_eval_defs.h"
-#include "nvim/garray_defs.h"
-#include "nvim/pos_defs.h"
-#include "nvim/types_defs.h"
typedef enum {
ETYPE_TOP, ///< toplevel
diff --git a/src/nvim/search.c b/src/nvim/search.c
index 067d91be69..273a924876 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -10,7 +10,9 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cmdhist.h"
@@ -19,19 +21,23 @@
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
#include "nvim/ex_cmds.h"
+#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/indent_c.h"
#include "nvim/insexpand.h"
#include "nvim/macros_defs.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
@@ -52,6 +58,7 @@
#include "nvim/strings.h"
#include "nvim/tag.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
diff --git a/src/nvim/shada.c b/src/nvim/shada.c
index 0544529304..61c43e271b 100644
--- a/src/nvim/shada.c
+++ b/src/nvim/shada.c
@@ -13,36 +13,47 @@
#include <uv.h>
#include "auto/config.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/cmdhist.h"
#include "nvim/eval.h"
#include "nvim/eval/decode.h"
#include "nvim/eval/encode.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds.h"
+#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
+#include "nvim/hashtab_defs.h"
#include "nvim/macros_defs.h"
#include "nvim/map_defs.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/msgpack_rpc/helpers.h"
-#include "nvim/normal.h"
+#include "nvim/normal_defs.h"
#include "nvim/ops.h"
#include "nvim/option.h"
#include "nvim/option_vars.h"
#include "nvim/os/fileio.h"
+#include "nvim/os/fileio_defs.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/time.h"
+#include "nvim/os/time_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"
diff --git a/src/nvim/sign.c b/src/nvim/sign.c
index 1b33848e34..e8d4f4b163 100644
--- a/src/nvim/sign.c
+++ b/src/nvim/sign.c
@@ -9,29 +9,36 @@
#include "klib/kvec.h"
#include "nvim/api/extmark.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand_defs.h"
#include "nvim/cursor.h"
#include "nvim/decoration.h"
+#include "nvim/decoration_defs.h"
#include "nvim/drawscreen.h"
#include "nvim/edit.h"
#include "nvim/eval/funcs.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/extmark.h"
#include "nvim/fold.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/macros_defs.h"
#include "nvim/map_defs.h"
#include "nvim/marktree.h"
+#include "nvim/marktree_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
#include "nvim/message.h"
diff --git a/src/nvim/sign.h b/src/nvim/sign.h
index 2b6497c255..c6d9e1002c 100644
--- a/src/nvim/sign.h
+++ b/src/nvim/sign.h
@@ -2,7 +2,7 @@
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
-#include "nvim/sign_defs.h" // IWYU pragma: export
+#include "nvim/sign_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index f4b1127ef1..c2091c6bae 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -63,7 +63,9 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
@@ -74,19 +76,23 @@
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
+#include "nvim/hashtab_defs.h"
#include "nvim/highlight_defs.h"
#include "nvim/insexpand.h"
#include "nvim/log.h"
#include "nvim/macros_defs.h"
-#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
#include "nvim/os/input.h"
@@ -94,6 +100,7 @@
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/runtime.h"
#include "nvim/search.h"
#include "nvim/spell.h"
diff --git a/src/nvim/spell.h b/src/nvim/spell.h
index 1462c45f5c..adbdd3705e 100644
--- a/src/nvim/spell.h
+++ b/src/nvim/spell.h
@@ -1,7 +1,9 @@
#pragma once
+#include <stdbool.h>
+
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
-#include "nvim/spell_defs.h" // IWYU pragma: export
+#include "nvim/spell_defs.h" // IWYU pragma: keep
#include "nvim/vim_defs.h" // IWYU pragma: keep
/// First language that is loaded, start of the linked list of loaded languages.
diff --git a/src/nvim/spell_defs.h b/src/nvim/spell_defs.h
index e98689f0c1..005f3aa9e4 100644
--- a/src/nvim/spell_defs.h
+++ b/src/nvim/spell_defs.h
@@ -4,9 +4,6 @@
#include <stdint.h>
#include "nvim/buffer_defs.h"
-#include "nvim/garray_defs.h"
-#include "nvim/hashtab_defs.h"
-#include "nvim/regexp_defs.h"
enum {
/// Assume max. word len is this many bytes.
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c
index 3f3908585d..1c632d2700 100644
--- a/src/nvim/spellfile.c
+++ b/src/nvim/spellfile.c
@@ -237,29 +237,37 @@
#include "nvim/arglist.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/drawscreen.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
+#include "nvim/hashtab_defs.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/os/time.h"
+#include "nvim/os/time_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/regexp.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/spell.h"
#include "nvim/spell_defs.h"
#include "nvim/spellfile.h"
diff --git a/src/nvim/spellsuggest.c b/src/nvim/spellsuggest.c
index 0736ad81cf..887ad3a62a 100644
--- a/src/nvim/spellsuggest.c
+++ b/src/nvim/spellsuggest.c
@@ -16,17 +16,20 @@
#include "nvim/cursor.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/fileio.h"
#include "nvim/garray.h"
#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
+#include "nvim/hashtab_defs.h"
#include "nvim/highlight_defs.h"
#include "nvim/input.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
@@ -39,11 +42,13 @@
#include "nvim/pos_defs.h"
#include "nvim/profile.h"
#include "nvim/spell.h"
+#include "nvim/spell_defs.h"
#include "nvim/spellfile.h"
#include "nvim/spellsuggest.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/undo.h"
#include "nvim/vim_defs.h"
diff --git a/src/nvim/state.c b/src/nvim/state.c
index a22081ceaa..527acee306 100644
--- a/src/nvim/state.c
+++ b/src/nvim/state.c
@@ -3,10 +3,13 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer_defs.h"
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
+#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/ex_getln.h"
diff --git a/src/nvim/state.h b/src/nvim/state.h
index 8c5957bf9a..9002f018d2 100644
--- a/src/nvim/state.h
+++ b/src/nvim/state.h
@@ -1,6 +1,6 @@
#pragma once
-#include "nvim/state_defs.h" // IWYU pragma: export
+#include "nvim/state_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "state.h.generated.h"
diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c
index 95d23d76f0..dac3354f90 100644
--- a/src/nvim/statusline.c
+++ b/src/nvim/statusline.c
@@ -6,9 +6,11 @@
#include <stdlib.h>
#include <string.h>
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/digraph.h"
#include "nvim/drawline.h"
@@ -16,30 +18,37 @@
#include "nvim/eval.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/eval/vars.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
+#include "nvim/memline_defs.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/message.h"
#include "nvim/normal.h"
#include "nvim/option.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/path.h"
#include "nvim/plines.h"
#include "nvim/pos_defs.h"
#include "nvim/sign.h"
+#include "nvim/sign_defs.h"
#include "nvim/state_defs.h"
#include "nvim/statusline.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/undo.h"
#include "nvim/window.h"
diff --git a/src/nvim/statusline.h b/src/nvim/statusline.h
index 36fc5be68e..1a5f12dbf4 100644
--- a/src/nvim/statusline.h
+++ b/src/nvim/statusline.h
@@ -4,7 +4,7 @@
#include "nvim/macros_defs.h"
#include "nvim/option_defs.h" // IWYU pragma: keep
-#include "nvim/statusline_defs.h" // IWYU pragma: export
+#include "nvim/statusline_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
/// Array defining what should be done when tabline is clicked
diff --git a/src/nvim/strings.c b/src/nvim/strings.c
index fab04438b6..468e9213a9 100644
--- a/src/nvim/strings.c
+++ b/src/nvim/strings.c
@@ -17,11 +17,13 @@
#include "nvim/eval/typval_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/macros_defs.h"
#include "nvim/math.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option.h"
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 30cb3681d4..ab8ab62b90 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -9,7 +9,9 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand_defs.h"
#include "nvim/drawscreen.h"
@@ -20,10 +22,13 @@
#include "nvim/ex_docmd.h"
#include "nvim/fold.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
+#include "nvim/hashtab_defs.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/indent_c.h"
#include "nvim/macros_defs.h"
@@ -38,6 +43,7 @@
#include "nvim/pos_defs.h"
#include "nvim/profile.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/runtime.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
diff --git a/src/nvim/syntax.h b/src/nvim/syntax.h
index f07ad238d3..69fc1a74b8 100644
--- a/src/nvim/syntax.h
+++ b/src/nvim/syntax.h
@@ -3,7 +3,7 @@
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
-#include "nvim/syntax_defs.h" // IWYU pragma: export
+#include "nvim/syntax_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
enum {
diff --git a/src/nvim/syntax_defs.h b/src/nvim/syntax_defs.h
index 224e2d8f7c..94ca2c4cba 100644
--- a/src/nvim/syntax_defs.h
+++ b/src/nvim/syntax_defs.h
@@ -1,9 +1,6 @@
#pragma once
#include "nvim/buffer_defs.h"
-#include "nvim/garray_defs.h"
-#include "nvim/highlight_defs.h"
-#include "nvim/regexp_defs.h"
#define SST_MIN_ENTRIES 150 // minimal size for state stack array
#define SST_MAX_ENTRIES 1000 // maximal size for state stack array
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index f7e30a8267..19aabb3aba 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -10,9 +10,12 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/cmdexpand.h"
+#include "nvim/cmdexpand_defs.h"
#include "nvim/cursor.h"
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
@@ -24,16 +27,21 @@
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
+#include "nvim/hashtab_defs.h"
#include "nvim/help.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/input.h"
#include "nvim/insexpand.h"
#include "nvim/macros_defs.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/move.h"
@@ -49,6 +57,7 @@
#include "nvim/pos_defs.h"
#include "nvim/quickfix.h"
#include "nvim/regexp.h"
+#include "nvim/regexp_defs.h"
#include "nvim/runtime.h"
#include "nvim/search.h"
#include "nvim/state_defs.h"
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c
index 8b29fcfa42..8bee5071af 100644
--- a/src/nvim/terminal.c
+++ b/src/nvim/terminal.c
@@ -47,14 +47,19 @@
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/change.h"
#include "nvim/channel.h"
+#include "nvim/channel_defs.h"
#include "nvim/cursor.h"
#include "nvim/drawline.h"
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
+#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
#include "nvim/event/time.h"
@@ -62,6 +67,7 @@
#include "nvim/getchar.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
@@ -73,13 +79,15 @@
#include "nvim/mouse.h"
#include "nvim/move.h"
#include "nvim/msgpack_rpc/channel_defs.h"
-#include "nvim/normal.h"
+#include "nvim/normal_defs.h"
#include "nvim/ops.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/optionstr.h"
#include "nvim/pos_defs.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/terminal.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/testing.c b/src/nvim/testing.c
index 6515da7500..343568d71e 100644
--- a/src/nvim/testing.c
+++ b/src/nvim/testing.c
@@ -13,15 +13,18 @@
#include "nvim/eval/typval_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/garray_defs.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/hashtab.h"
+#include "nvim/hashtab_defs.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/os/fs.h"
#include "nvim/runtime.h"
+#include "nvim/runtime_defs.h"
#include "nvim/strings.h"
#include "nvim/testing.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/textformat.c b/src/nvim/textformat.c
index 509a88e441..e1b6d3acc9 100644
--- a/src/nvim/textformat.c
+++ b/src/nvim/textformat.c
@@ -26,6 +26,7 @@
#include "nvim/move.h"
#include "nvim/ops.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/os/input.h"
#include "nvim/pos_defs.h"
diff --git a/src/nvim/textobject.c b/src/nvim/textobject.c
index 76ea24039a..d9c2b3b111 100644
--- a/src/nvim/textobject.c
+++ b/src/nvim/textobject.c
@@ -15,6 +15,7 @@
#include "nvim/globals.h"
#include "nvim/indent.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c
index 903e12b095..214474ff51 100644
--- a/src/nvim/tui/input.c
+++ b/src/nvim/tui/input.c
@@ -4,6 +4,7 @@
#include <string.h>
#include "klib/kvec.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/event/loop.h"
#include "nvim/event/stream.h"
@@ -13,6 +14,7 @@
#include "nvim/memory.h"
#include "nvim/option_vars.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/rbuffer.h"
#include "nvim/strings.h"
#include "nvim/tui/input.h"
diff --git a/src/nvim/tui/input.h b/src/nvim/tui/input.h
index 2da7f95338..bf6d0f2978 100644
--- a/src/nvim/tui/input.h
+++ b/src/nvim/tui/input.h
@@ -4,10 +4,10 @@
#include <stdint.h>
#include <uv.h>
-#include "nvim/event/stream.h"
+#include "nvim/event/defs.h"
#include "nvim/rbuffer_defs.h"
-#include "nvim/tui/input_defs.h" // IWYU pragma: export
-#include "nvim/tui/tui.h"
+#include "nvim/tui/input_defs.h" // IWYU pragma: keep
+#include "nvim/tui/tui_defs.h"
#include "nvim/types_defs.h"
#include "termkey/termkey.h"
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 934b498df9..9cd0c64bfe 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -15,11 +15,13 @@
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/cursor_shape.h"
+#include "nvim/event/defs.h"
#include "nvim/event/loop.h"
#include "nvim/event/signal.h"
#include "nvim/event/stream.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/highlight_defs.h"
#include "nvim/log.h"
#include "nvim/macros_defs.h"
@@ -29,6 +31,7 @@
#include "nvim/msgpack_rpc/channel.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
+#include "nvim/os/os_defs.h"
#include "nvim/tui/input.h"
#include "nvim/tui/terminfo.h"
#include "nvim/tui/tui.h"
diff --git a/src/nvim/tui/tui.h b/src/nvim/tui/tui.h
index 34a98004f3..12e0491b4b 100644
--- a/src/nvim/tui/tui.h
+++ b/src/nvim/tui/tui.h
@@ -1,24 +1,9 @@
#pragma once
-#include "nvim/api/private/defs.h" // IWYU pragma: keep
#include "nvim/highlight_defs.h" // IWYU pragma: keep
-#include "nvim/types_defs.h" // IWYU pragma: keep
+#include "nvim/tui/tui_defs.h" // IWYU pragma: keep
#include "nvim/ui_defs.h" // IWYU pragma: keep
-typedef struct TUIData TUIData;
-
-typedef enum {
- kTermModeSynchronizedOutput = 2026,
-} TermMode;
-
-typedef enum {
- kTermModeNotRecognized = 0,
- kTermModeSet = 1,
- kTermModeReset = 2,
- kTermModePermanentlySet = 3,
- kTermModePermanentlyReset = 4,
-} TermModeState;
-
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "tui/tui.h.generated.h"
#endif
diff --git a/src/nvim/tui/tui_defs.h b/src/nvim/tui/tui_defs.h
new file mode 100644
index 0000000000..c5149d4829
--- /dev/null
+++ b/src/nvim/tui/tui_defs.h
@@ -0,0 +1,15 @@
+#pragma once
+
+typedef struct TUIData TUIData;
+
+typedef enum {
+ kTermModeSynchronizedOutput = 2026,
+} TermMode;
+
+typedef enum {
+ kTermModeNotRecognized = 0,
+ kTermModeSet = 1,
+ kTermModeReset = 2,
+ kTermModePermanentlySet = 3,
+ kTermModePermanentlyReset = 4,
+} TermModeState;
diff --git a/src/nvim/types_defs.h b/src/nvim/types_defs.h
index 0573439b73..99f448d8a1 100644
--- a/src/nvim/types_defs.h
+++ b/src/nvim/types_defs.h
@@ -1,6 +1,5 @@
#pragma once
-#include <stdbool.h>
#include <stdint.h>
// dummy to pass an ACL to a function
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index 9116bb22a2..8888535878 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -12,11 +12,12 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/cursor_shape.h"
#include "nvim/drawscreen.h"
#include "nvim/event/multiqueue.h"
#include "nvim/ex_getln.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/highlight.h"
@@ -25,8 +26,10 @@
#include "nvim/lua/executor.h"
#include "nvim/map_defs.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/message.h"
#include "nvim/option.h"
+#include "nvim/option_defs.h"
#include "nvim/option_vars.h"
#include "nvim/os/time.h"
#include "nvim/state_defs.h"
@@ -448,13 +451,12 @@ void ui_set_ext_option(UI *ui, UIExtension ext, bool active)
}
}
-void ui_line(ScreenGrid *grid, int row, int startcol, int endcol, int clearcol, int clearattr,
- bool wrap)
+void ui_line(ScreenGrid *grid, int row, bool invalid_row, int startcol, int endcol, int clearcol,
+ int clearattr, bool wrap)
{
assert(0 <= row && row < grid->rows);
LineFlags flags = wrap ? kLineFlagWrap : 0;
- if (startcol == -1) {
- startcol = 0;
+ if (startcol == 0 && invalid_row) {
flags |= kLineFlagInvalid;
}
diff --git a/src/nvim/ui.h b/src/nvim/ui.h
index b783e4b6d3..ef75bf62d9 100644
--- a/src/nvim/ui.h
+++ b/src/nvim/ui.h
@@ -8,7 +8,7 @@
#include "nvim/highlight_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
#include "nvim/types_defs.h" // IWYU pragma: keep
-#include "nvim/ui_defs.h" // IWYU pragma: export
+#include "nvim/ui_defs.h" // IWYU pragma: keep
/// Keep in sync with UIExtension in ui_defs.h
EXTERN const char *ui_ext_names[] INIT( = {
diff --git a/src/nvim/ui_client.c b/src/nvim/ui_client.c
index c7c0457fcd..055e234d67 100644
--- a/src/nvim/ui_client.c
+++ b/src/nvim/ui_client.c
@@ -5,22 +5,29 @@
#include <stdlib.h>
#include "nvim/api/keysets_defs.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/dispatch.h"
#include "nvim/api/private/helpers.h"
#include "nvim/channel.h"
+#include "nvim/channel_defs.h"
#include "nvim/eval.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/event/multiqueue.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/log.h"
#include "nvim/main.h"
#include "nvim/memory.h"
+#include "nvim/memory_defs.h"
#include "nvim/msgpack_rpc/channel.h"
+#include "nvim/msgpack_rpc/channel_defs.h"
#include "nvim/os/os_defs.h"
#include "nvim/tui/tui.h"
+#include "nvim/tui/tui_defs.h"
#include "nvim/ui.h"
#include "nvim/ui_client.h"
+#include "nvim/ui_defs.h"
#ifdef MSWIN
# include "nvim/os/os_win_console.h"
diff --git a/src/nvim/ui_client.h b/src/nvim/ui_client.h
index 8603ae9ca1..d3be9882aa 100644
--- a/src/nvim/ui_client.h
+++ b/src/nvim/ui_client.h
@@ -4,15 +4,10 @@
#include <stddef.h>
#include <stdint.h>
-#include "nvim/api/private/defs.h"
#include "nvim/grid_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
#include "nvim/types_defs.h"
-
-typedef struct {
- const char *name;
- void (*fn)(Array args);
-} UIClientHandler;
+#include "nvim/ui_defs.h" // IWYU pragma: keep
// Temporary buffer for converting a single grid_line event
EXTERN size_t grid_line_buf_size INIT( = 0);
diff --git a/src/nvim/ui_compositor.c b/src/nvim/ui_compositor.c
index 4cd11f3ccf..85e7d63e11 100644
--- a/src/nvim/ui_compositor.c
+++ b/src/nvim/ui_compositor.c
@@ -18,6 +18,7 @@
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/highlight_group.h"
#include "nvim/log.h"
#include "nvim/macros_defs.h"
diff --git a/src/nvim/ui_defs.h b/src/nvim/ui_defs.h
index c4707d4d7c..2245575306 100644
--- a/src/nvim/ui_defs.h
+++ b/src/nvim/ui_defs.h
@@ -93,3 +93,8 @@ struct ui_t {
// TODO(bfredl): integrate into struct!
UIData data[1];
};
+
+typedef struct {
+ const char *name;
+ void (*fn)(Array args);
+} UIClientHandler;
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index df38b3cb02..b08ce96568 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -85,6 +85,7 @@
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/buffer_updates.h"
#include "nvim/change.h"
#include "nvim/cursor.h"
@@ -96,25 +97,32 @@
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/extmark.h"
+#include "nvim/extmark_defs.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/garray.h"
+#include "nvim/garray_defs.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/macros_defs.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
+#include "nvim/memline_defs.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/option.h"
#include "nvim/option_vars.h"
#include "nvim/os/fs.h"
+#include "nvim/os/fs_defs.h"
#include "nvim/os/input.h"
#include "nvim/os/os_defs.h"
#include "nvim/os/time.h"
+#include "nvim/os/time_defs.h"
#include "nvim/path.h"
#include "nvim/pos_defs.h"
#include "nvim/sha256.h"
diff --git a/src/nvim/undo.h b/src/nvim/undo.h
index a70b1fe486..800a1bfae0 100644
--- a/src/nvim/undo.h
+++ b/src/nvim/undo.h
@@ -4,7 +4,7 @@
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
#include "nvim/pos_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
-#include "nvim/undo_defs.h" // IWYU pragma: export
+#include "nvim/undo_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "undo.h.generated.h"
diff --git a/src/nvim/undo_defs.h b/src/nvim/undo_defs.h
index e38b5e88fe..39786fa928 100644
--- a/src/nvim/undo_defs.h
+++ b/src/nvim/undo_defs.h
@@ -4,7 +4,6 @@
#include "nvim/extmark_defs.h"
#include "nvim/mark_defs.h"
-#include "nvim/pos_defs.h"
enum { UNDO_HASH_SIZE = 32, }; ///< Size in bytes of the hash used in the undo file.
diff --git a/src/nvim/usercmd.c b/src/nvim/usercmd.c
index 39f80878c9..e20c3f6044 100644
--- a/src/nvim/usercmd.c
+++ b/src/nvim/usercmd.c
@@ -16,9 +16,10 @@
#include "nvim/eval.h"
#include "nvim/ex_docmd.h"
#include "nvim/garray.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/keycodes.h"
#include "nvim/lua/executor.h"
#include "nvim/macros_defs.h"
diff --git a/src/nvim/usercmd.h b/src/nvim/usercmd.h
index 4ad9767e1f..84a8f61719 100644
--- a/src/nvim/usercmd.h
+++ b/src/nvim/usercmd.h
@@ -8,7 +8,7 @@
#include "nvim/eval/typval_defs.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/garray_defs.h"
-#include "nvim/types_defs.h" // IWYU pragma: keep
+#include "nvim/types_defs.h"
typedef struct {
char *uc_name; ///< The command name
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 5da35a9724..a2d9bcc8a1 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -16,13 +16,15 @@
#include "nvim/api/private/helpers.h"
#include "nvim/ascii_defs.h"
#include "nvim/buffer.h"
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/drawscreen.h"
#include "nvim/ex_cmds_defs.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/highlight.h"
+#include "nvim/highlight_defs.h"
#include "nvim/lua/executor.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
diff --git a/src/nvim/vim_defs.h b/src/nvim/vim_defs.h
index 4cd0097cdf..f6b348e009 100644
--- a/src/nvim/vim_defs.h
+++ b/src/nvim/vim_defs.h
@@ -1,8 +1,5 @@
#pragma once
-#include "auto/config.h"
-#include "nvim/os/os_defs.h" // IWYU pragma: keep
-
// Some defines from the old feature.h
#define SESSION_FILE "Session.vim"
#define MAX_MSG_HIST_LEN 200
diff --git a/src/nvim/viml/parser/expressions.c b/src/nvim/viml/parser/expressions.c
index 11f5276053..3403fb7926 100644
--- a/src/nvim/viml/parser/expressions.c
+++ b/src/nvim/viml/parser/expressions.c
@@ -59,7 +59,7 @@
#include "nvim/assert_defs.h"
#include "nvim/charset.h"
#include "nvim/eval.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
#include "nvim/mbyte.h"
diff --git a/src/nvim/viml/parser/expressions.h b/src/nvim/viml/parser/expressions.h
index ff33b9ead1..ba54c4de07 100644
--- a/src/nvim/viml/parser/expressions.h
+++ b/src/nvim/viml/parser/expressions.h
@@ -6,7 +6,7 @@
#include "nvim/eval/typval_defs.h"
#include "nvim/types_defs.h"
-#include "nvim/viml/parser/parser.h"
+#include "nvim/viml/parser/parser_defs.h"
// Defines whether to ignore case:
// == kCCStrategyUseOption
diff --git a/src/nvim/viml/parser/parser.c b/src/nvim/viml/parser/parser.c
index d8679208c3..bdade3fae2 100644
--- a/src/nvim/viml/parser/parser.c
+++ b/src/nvim/viml/parser/parser.c
@@ -1,3 +1,6 @@
+#include "nvim/func_attr.h"
+#include "nvim/mbyte.h"
+#include "nvim/memory.h"
#include "nvim/viml/parser/parser.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
@@ -11,3 +14,62 @@ void parser_simple_get_line(void *cookie, ParserLine *ret_pline)
*ret_pline = **plines_p;
(*plines_p)++;
}
+
+/// Get currently parsed line, shifted to pstate->pos.col
+///
+/// @param pstate Parser state to operate on.
+///
+/// @return True if there is a line, false in case of EOF.
+bool viml_parser_get_remaining_line(ParserState *const pstate, ParserLine *const ret_pline)
+ FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
+{
+ const size_t num_lines = kv_size(pstate->reader.lines);
+ if (pstate->pos.line == num_lines) {
+ viml_preader_get_line(&pstate->reader, ret_pline);
+ } else {
+ *ret_pline = kv_last(pstate->reader.lines);
+ }
+ assert(pstate->pos.line == kv_size(pstate->reader.lines) - 1);
+ if (ret_pline->data != NULL) {
+ ret_pline->data += pstate->pos.col;
+ ret_pline->size -= pstate->pos.col;
+ }
+ return ret_pline->data != NULL;
+}
+
+/// Get one line from ParserInputReader
+static void viml_preader_get_line(ParserInputReader *const preader, ParserLine *const ret_pline)
+ FUNC_ATTR_NONNULL_ALL
+{
+ ParserLine pline;
+ preader->get_line(preader->cookie, &pline);
+ if (preader->conv.vc_type != CONV_NONE && pline.size) {
+ ParserLine cpline = {
+ .allocated = true,
+ .size = pline.size,
+ };
+ cpline.data = string_convert(&preader->conv, (char *)pline.data, &cpline.size);
+ if (pline.allocated) {
+ xfree((void *)pline.data);
+ }
+ pline = cpline;
+ }
+ kvi_push(preader->lines, pline);
+ *ret_pline = pline;
+}
+
+/// Free all memory allocated by the parser on heap
+///
+/// @param pstate Parser state to free.
+void viml_parser_destroy(ParserState *const pstate)
+ FUNC_ATTR_NONNULL_ALL
+{
+ for (size_t i = 0; i < kv_size(pstate->reader.lines); i++) {
+ ParserLine pline = kv_A(pstate->reader.lines, i);
+ if (pline.allocated) {
+ xfree((void *)pline.data);
+ }
+ }
+ kvi_destroy(pstate->reader.lines);
+ kvi_destroy(pstate->stack);
+}
diff --git a/src/nvim/viml/parser/parser.h b/src/nvim/viml/parser/parser.h
index b29a77b5ef..31decdc798 100644
--- a/src/nvim/viml/parser/parser.h
+++ b/src/nvim/viml/parser/parser.h
@@ -6,79 +6,8 @@
#include "klib/kvec.h"
#include "nvim/func_attr.h"
-#include "nvim/mbyte.h"
-#include "nvim/memory.h"
-
-/// One parsed line
-typedef struct {
- const char *data; ///< Parsed line pointer
- size_t size; ///< Parsed line size
- bool allocated; ///< True if line may be freed.
-} ParserLine;
-
-/// Line getter type for parser
-///
-/// Line getter must return {NULL, 0} for EOF.
-typedef void (*ParserLineGetter)(void *cookie, ParserLine *ret_pline);
-
-/// Parser position in the input
-typedef struct {
- size_t line; ///< Line index in ParserInputReader.lines.
- size_t col; ///< Byte index in the line.
-} ParserPosition;
-
-/// Parser state item.
-typedef struct {
- enum {
- kPTopStateParsingCommand = 0,
- kPTopStateParsingExpression,
- } type;
- union {
- struct {
- enum {
- kExprUnknown = 0,
- } type;
- } expr;
- } data;
-} ParserStateItem;
-
-/// Structure defining input reader
-typedef struct {
- /// Function used to get next line.
- ParserLineGetter get_line;
- /// Data for get_line function.
- void *cookie;
- /// All lines obtained by get_line.
- kvec_withinit_t(ParserLine, 4) lines;
- /// Conversion, for :scriptencoding.
- vimconv_T conv;
-} ParserInputReader;
-
-/// Highlighted region definition
-///
-/// Note: one chunk may highlight only one line.
-typedef struct {
- ParserPosition start; ///< Start of the highlight: line and column.
- size_t end_col; ///< End column, points to the start of the next character.
- const char *group; ///< Highlight group.
-} ParserHighlightChunk;
-
-/// Highlighting defined by a parser
-typedef kvec_withinit_t(ParserHighlightChunk, 16) ParserHighlight;
-
-/// Structure defining parser state
-typedef struct {
- /// Line reader.
- ParserInputReader reader;
- /// Position up to which input was parsed.
- ParserPosition pos;
- /// Parser state stack.
- kvec_withinit_t(ParserStateItem, 16) stack;
- /// Highlighting support.
- ParserHighlight *colors;
- /// True if line continuation can be used.
- bool can_continuate;
-} ParserState;
+#include "nvim/mbyte_defs.h"
+#include "nvim/viml/parser/parser_defs.h" // IWYU pragma: keep
static inline void viml_parser_init(ParserState *ret_pstate, ParserLineGetter get_line,
void *cookie, ParserHighlight *colors)
@@ -108,73 +37,6 @@ static inline void viml_parser_init(ParserState *const ret_pstate, const ParserL
kvi_init(ret_pstate->stack);
}
-static inline void viml_parser_destroy(ParserState *pstate)
- REAL_FATTR_NONNULL_ALL REAL_FATTR_ALWAYS_INLINE;
-
-/// Free all memory allocated by the parser on heap
-///
-/// @param pstate Parser state to free.
-static inline void viml_parser_destroy(ParserState *const pstate)
-{
- for (size_t i = 0; i < kv_size(pstate->reader.lines); i++) {
- ParserLine pline = kv_A(pstate->reader.lines, i);
- if (pline.allocated) {
- xfree((void *)pline.data);
- }
- }
- kvi_destroy(pstate->reader.lines);
- kvi_destroy(pstate->stack);
-}
-
-static inline void viml_preader_get_line(ParserInputReader *preader, ParserLine *ret_pline)
- REAL_FATTR_NONNULL_ALL;
-
-/// Get one line from ParserInputReader
-static inline void viml_preader_get_line(ParserInputReader *const preader,
- ParserLine *const ret_pline)
-{
- ParserLine pline;
- preader->get_line(preader->cookie, &pline);
- if (preader->conv.vc_type != CONV_NONE && pline.size) {
- ParserLine cpline = {
- .allocated = true,
- .size = pline.size,
- };
- cpline.data = string_convert(&preader->conv, (char *)pline.data, &cpline.size);
- if (pline.allocated) {
- xfree((void *)pline.data);
- }
- pline = cpline;
- }
- kvi_push(preader->lines, pline);
- *ret_pline = pline;
-}
-
-static inline bool viml_parser_get_remaining_line(ParserState *pstate, ParserLine *ret_pline)
- REAL_FATTR_ALWAYS_INLINE REAL_FATTR_WARN_UNUSED_RESULT REAL_FATTR_NONNULL_ALL;
-
-/// Get currently parsed line, shifted to pstate->pos.col
-///
-/// @param pstate Parser state to operate on.
-///
-/// @return True if there is a line, false in case of EOF.
-static inline bool viml_parser_get_remaining_line(ParserState *const pstate,
- ParserLine *const ret_pline)
-{
- const size_t num_lines = kv_size(pstate->reader.lines);
- if (pstate->pos.line == num_lines) {
- viml_preader_get_line(&pstate->reader, ret_pline);
- } else {
- *ret_pline = kv_last(pstate->reader.lines);
- }
- assert(pstate->pos.line == kv_size(pstate->reader.lines) - 1);
- if (ret_pline->data != NULL) {
- ret_pline->data += pstate->pos.col;
- ret_pline->size -= pstate->pos.col;
- }
- return ret_pline->data != NULL;
-}
-
static inline void viml_parser_advance(ParserState *pstate, size_t len)
REAL_FATTR_ALWAYS_INLINE REAL_FATTR_NONNULL_ALL;
diff --git a/src/nvim/viml/parser/parser_defs.h b/src/nvim/viml/parser/parser_defs.h
new file mode 100644
index 0000000000..59fab23054
--- /dev/null
+++ b/src/nvim/viml/parser/parser_defs.h
@@ -0,0 +1,79 @@
+#pragma once
+
+#include <assert.h>
+#include <stdbool.h>
+#include <stddef.h>
+
+#include "klib/kvec.h"
+#include "nvim/mbyte_defs.h"
+
+/// One parsed line
+typedef struct {
+ const char *data; ///< Parsed line pointer
+ size_t size; ///< Parsed line size
+ bool allocated; ///< True if line may be freed.
+} ParserLine;
+
+/// Line getter type for parser
+///
+/// Line getter must return {NULL, 0} for EOF.
+typedef void (*ParserLineGetter)(void *cookie, ParserLine *ret_pline);
+
+/// Parser position in the input
+typedef struct {
+ size_t line; ///< Line index in ParserInputReader.lines.
+ size_t col; ///< Byte index in the line.
+} ParserPosition;
+
+/// Parser state item.
+typedef struct {
+ enum {
+ kPTopStateParsingCommand = 0,
+ kPTopStateParsingExpression,
+ } type;
+ union {
+ struct {
+ enum {
+ kExprUnknown = 0,
+ } type;
+ } expr;
+ } data;
+} ParserStateItem;
+
+/// Structure defining input reader
+typedef struct {
+ /// Function used to get next line.
+ ParserLineGetter get_line;
+ /// Data for get_line function.
+ void *cookie;
+ /// All lines obtained by get_line.
+ kvec_withinit_t(ParserLine, 4) lines;
+ /// Conversion, for :scriptencoding.
+ vimconv_T conv;
+} ParserInputReader;
+
+/// Highlighted region definition
+///
+/// Note: one chunk may highlight only one line.
+typedef struct {
+ ParserPosition start; ///< Start of the highlight: line and column.
+ size_t end_col; ///< End column, points to the start of the next character.
+ const char *group; ///< Highlight group.
+} ParserHighlightChunk;
+
+/// Highlighting defined by a parser
+typedef kvec_withinit_t(ParserHighlightChunk, 16) ParserHighlight;
+
+/// Structure defining parser state
+typedef struct {
+ /// Line reader.
+ ParserInputReader reader;
+ /// Position up to which input was parsed.
+ ParserPosition pos;
+ /// Parser state stack.
+ kvec_withinit_t(ParserStateItem, 16) stack;
+ /// Highlighting support.
+ ParserHighlight *colors;
+ /// True if line continuation can be used.
+ bool can_continuate;
+} ParserState;
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 6a305f9b2f..d9a05cde17 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -8,10 +8,12 @@
#include <string.h>
#include "klib/kvec.h"
+#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/arglist.h"
#include "nvim/ascii_defs.h"
#include "nvim/autocmd.h"
+#include "nvim/autocmd_defs.h"
#include "nvim/buffer.h"
#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
@@ -22,10 +24,12 @@
#include "nvim/edit.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
+#include "nvim/eval/typval_defs.h"
#include "nvim/eval/vars.h"
#include "nvim/eval/window.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h"
+#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/ex_getln.h"
@@ -34,16 +38,18 @@
#include "nvim/fold.h"
#include "nvim/garray.h"
#include "nvim/getchar.h"
-#include "nvim/gettext.h"
+#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/hashtab.h"
#include "nvim/keycodes.h"
#include "nvim/macros_defs.h"
#include "nvim/main.h"
#include "nvim/map_defs.h"
-#include "nvim/mapping.h" // IWYU pragma: keep (langmap_adjust_mb)
+#include "nvim/mapping.h"
#include "nvim/mark.h"
+#include "nvim/mark_defs.h"
#include "nvim/match.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
@@ -62,6 +68,7 @@
#include "nvim/quickfix.h"
#include "nvim/search.h"
#include "nvim/state.h"
+#include "nvim/state_defs.h"
#include "nvim/statusline.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
@@ -69,6 +76,7 @@
#include "nvim/types_defs.h"
#include "nvim/ui.h"
#include "nvim/ui_compositor.h"
+#include "nvim/ui_defs.h"
#include "nvim/undo.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
diff --git a/src/nvim/winfloat.c b/src/nvim/winfloat.c
index 693f9cf1e6..1d22590ac0 100644
--- a/src/nvim/winfloat.c
+++ b/src/nvim/winfloat.c
@@ -11,6 +11,7 @@
#include "nvim/drawscreen.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
+#include "nvim/grid_defs.h"
#include "nvim/macros_defs.h"
#include "nvim/memory.h"
#include "nvim/mouse.h"
@@ -21,6 +22,7 @@
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/ui.h"
+#include "nvim/ui_defs.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
#include "nvim/winfloat.h"