commit 0c120307ca1ab613e63865c634d7e10ad67fb0ba parent cc6a257c8cad8051b6f7e9287249293ab0a929d9 Author: dundargoc <gocdundar@gmail.com> Date: Wed, 20 Dec 2023 14:32:22 +0100 refactor: eliminate cyclic includes Diffstat:
61 files changed, 107 insertions(+), 70 deletions(-)
diff --git a/.clang-tidy b/.clang-tidy @@ -46,7 +46,6 @@ Checks: > -cppcoreguidelines-init-variables, -llvm-header-guard, We use #pragma once, -llvmlibc-restrict-system-libc-headers, We want to use glibc, - -misc-header-include-cycle, Looks useful but redundant with IWYU. We may replace IWYU with this one day, -misc-include-cleaner, Looks useful but redundant with IWYU. We may replace IWYU with this one day, -misc-misplaced-const, -misc-no-recursion, diff --git a/src/nvim/api/autocmd.c b/src/nvim/api/autocmd.c @@ -20,6 +20,7 @@ #include "nvim/globals.h" #include "nvim/lua/executor.h" #include "nvim/memory.h" +#include "nvim/types_defs.h" #include "nvim/vim_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/api/deprecated.c b/src/nvim/api/deprecated.c @@ -21,6 +21,7 @@ #include "nvim/memory.h" #include "nvim/option.h" #include "nvim/pos_defs.h" +#include "nvim/types_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/deprecated.c.generated.h" diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c @@ -15,6 +15,7 @@ #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" diff --git a/src/nvim/api/vimscript.c b/src/nvim/api/vimscript.c @@ -11,6 +11,7 @@ #include "nvim/api/private/helpers.h" #include "nvim/api/vimscript.h" #include "nvim/ascii_defs.h" +#include "nvim/buffer_defs.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" #include "nvim/eval/userfunc.h" diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c @@ -23,6 +23,7 @@ #include "nvim/pos_defs.h" #include "nvim/strings.h" #include "nvim/syntax.h" +#include "nvim/types_defs.h" #include "nvim/ui.h" #include "nvim/window.h" #include "nvim/winfloat.h" diff --git a/src/nvim/autocmd.h b/src/nvim/autocmd.h @@ -13,6 +13,7 @@ #include "nvim/ex_cmds_defs.h" // IWYU pragma: keep #include "nvim/macros_defs.h" #include "nvim/pos_defs.h" +#include "nvim/types_defs.h" // Set by the apply_autocmds_group function if the given event is equal to // EVENT_FILETYPE. Used by the readfile function in order to determine if diff --git a/src/nvim/base64.c b/src/nvim/base64.c @@ -3,7 +3,6 @@ #include <stdint.h> #include <string.h> -#include "auto/config.h" #include "nvim/base64.h" #include "nvim/memory.h" diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h @@ -4,16 +4,6 @@ #include <stdint.h> #include <stdio.h> -typedef struct file_buffer buf_T; - -/// Reference to a buffer that stores the value of buf_free_count. -/// bufref_valid() only needs to check "buf" when the count differs. -typedef struct { - buf_T *br_buf; - int br_fnum; - int br_buf_free_count; -} bufref_T; - #include "klib/kvec.h" #include "nvim/api/private/defs.h" #include "nvim/arglist_defs.h" @@ -27,11 +17,24 @@ typedef struct { #include "nvim/mapping_defs.h" #include "nvim/mark_defs.h" #include "nvim/marktree_defs.h" +#include "nvim/memline_defs.h" #include "nvim/option_vars.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/terminal.h" #include "nvim/undo_defs.h" +/// Reference to a buffer that stores the value of buf_free_count. +/// bufref_valid() only needs to check "buf" when the count differs. +typedef struct { + buf_T *br_buf; + int br_fnum; + int br_buf_free_count; +} bufref_T; + #define GETFILE_SUCCESS(x) ((x) <= 0) #define MODIFIABLE(buf) (buf->b_p_ma) @@ -80,18 +83,10 @@ typedef struct { // Mask to check for flags that prevent normal writing #define BF_WRITE_MASK (BF_NOTEDITED + BF_NEW + BF_READERR) -typedef struct window_S win_T; typedef struct wininfo_S wininfo_T; typedef struct frame_S frame_T; typedef uint64_t disptick_T; // display tick type -#include "nvim/memline_defs.h" -#include "nvim/os/fs_defs.h" -#include "nvim/regexp_defs.h" -#include "nvim/sign_defs.h" -#include "nvim/syntax_defs.h" -#include "nvim/terminal.h" - // The taggy struct is used to store the information about a :tag command. typedef struct taggy { char *tagname; // tag name diff --git a/src/nvim/change.c b/src/nvim/change.c @@ -44,6 +44,7 @@ #include "nvim/state.h" #include "nvim/strings.h" #include "nvim/textformat.h" +#include "nvim/types_defs.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim_defs.h" diff --git a/src/nvim/channel.c b/src/nvim/channel.c @@ -34,6 +34,7 @@ #include "nvim/os/shell.h" #include "nvim/path.h" #include "nvim/rbuffer.h" +#include "nvim/terminal.h" #include "nvim/types_defs.h" #ifdef MSWIN diff --git a/src/nvim/charset.c b/src/nvim/charset.c @@ -27,6 +27,7 @@ #include "nvim/path.h" #include "nvim/pos_defs.h" #include "nvim/strings.h" +#include "nvim/types_defs.h" #include "nvim/vim_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c @@ -22,6 +22,7 @@ #include "nvim/plines.h" #include "nvim/pos_defs.h" #include "nvim/state.h" +#include "nvim/types_defs.h" #include "nvim/vim_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c @@ -8,6 +8,7 @@ #include <string.h> #include "nvim/ascii_defs.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cmdexpand_defs.h" #include "nvim/debugger.h" @@ -32,6 +33,7 @@ #include "nvim/regexp.h" #include "nvim/runtime.h" #include "nvim/state_defs.h" +#include "nvim/types_defs.h" #include "nvim/vim_defs.h" /// batch mode debugging: don't save and restore typeahead. diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c @@ -6,6 +6,7 @@ #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" #include "nvim/drawscreen.h" #include "nvim/extmark.h" diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h @@ -5,7 +5,7 @@ #include <stdint.h> #include "klib/kvec.h" -#include "nvim/buffer_defs.h" +#include "nvim/buffer_defs.h" // IWYU pragma: keep #include "nvim/decoration_defs.h" // IWYU pragma: export #include "nvim/macros_defs.h" #include "nvim/marktree_defs.h" diff --git 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/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cmdexpand_defs.h" #include "nvim/debugger.h" diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c @@ -39,6 +39,7 @@ #include "nvim/pos_defs.h" #include "nvim/quickfix.h" #include "nvim/runtime.h" +#include "nvim/types_defs.h" #include "nvim/undo.h" #include "nvim/vim_defs.h" #include "nvim/window.h" diff --git a/src/nvim/ex_cmds_defs.h b/src/nvim/ex_cmds_defs.h @@ -6,6 +6,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" diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c @@ -34,6 +34,7 @@ #include "nvim/path.h" #include "nvim/pos_defs.h" #include "nvim/runtime.h" +#include "nvim/types_defs.h" #include "nvim/vim_defs.h" #include "nvim/window.h" diff --git a/src/nvim/extmark.c b/src/nvim/extmark.c @@ -39,6 +39,7 @@ #include "nvim/marktree.h" #include "nvim/memline.h" #include "nvim/pos_defs.h" +#include "nvim/types_defs.h" #include "nvim/undo.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c @@ -51,6 +51,7 @@ #include "nvim/ascii_defs.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" #include "nvim/file_search.h" diff --git a/src/nvim/help.c b/src/nvim/help.c @@ -36,7 +36,6 @@ #include "nvim/pos_defs.h" #include "nvim/runtime.h" #include "nvim/strings.h" -#include "nvim/syntax.h" #include "nvim/tag.h" #include "nvim/types_defs.h" #include "nvim/vim_defs.h" diff --git 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/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cmdexpand_defs.h" #include "nvim/cursor_shape.h" diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c @@ -23,6 +23,7 @@ #include "nvim/search.h" #include "nvim/state_defs.h" #include "nvim/strings.h" +#include "nvim/types_defs.h" #include "nvim/vim_defs.h" // Find result cache for cpp_baseclass diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c @@ -16,6 +16,7 @@ #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/ascii_defs.h" +#include "nvim/buffer_defs.h" #include "nvim/change.h" #include "nvim/cmdexpand_defs.h" #include "nvim/cursor.h" diff --git a/src/nvim/mark.c b/src/nvim/mark.c @@ -16,6 +16,7 @@ #include "nvim/eval/typval.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/globals.h" @@ -37,6 +38,7 @@ #include "nvim/quickfix.h" #include "nvim/strings.h" #include "nvim/textobject.h" +#include "nvim/types_defs.h" #include "nvim/vim_defs.h" // This file contains routines to maintain and manipulate marks. diff --git a/src/nvim/mark.h b/src/nvim/mark.h @@ -2,6 +2,7 @@ #include "nvim/ascii_defs.h" #include "nvim/ex_cmds_defs.h" // IWYU pragma: keep +#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 diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c @@ -60,6 +60,7 @@ #include "nvim/os/os.h" #include "nvim/path.h" #include "nvim/pos_defs.h" +#include "nvim/types_defs.h" #include "nvim/vim_defs.h" #define MEMFILE_PAGE_SIZE 4096 /// default page size diff --git a/src/nvim/memory.c b/src/nvim/memory.c @@ -36,6 +36,7 @@ #include "nvim/sign.h" #include "nvim/state_defs.h" #include "nvim/statusline.h" +#include "nvim/types_defs.h" #include "nvim/ui.h" #include "nvim/ui_client.h" #include "nvim/ui_compositor.h" diff --git a/src/nvim/memory.h b/src/nvim/memory.h @@ -2,6 +2,7 @@ #include <stdbool.h> #include <stdint.h> // IWYU pragma: keep +#include <string.h> #include <time.h> // IWYU pragma: keep #include "auto/config.h" diff --git a/src/nvim/menu.c b/src/nvim/menu.c @@ -8,6 +8,7 @@ #include "nvim/ascii_defs.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cmdexpand_defs.h" #include "nvim/cursor.h" diff --git a/src/nvim/normal.c b/src/nvim/normal.c @@ -70,6 +70,7 @@ #include "nvim/tag.h" #include "nvim/textformat.h" #include "nvim/textobject.h" +#include "nvim/types_defs.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim_defs.h" diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c @@ -26,6 +26,7 @@ #include "nvim/os/os.h" #include "nvim/path.h" #include "nvim/strings.h" +#include "nvim/types_defs.h" #include "nvim/version.h" #include "nvim/vim_defs.h" diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c @@ -8,6 +8,7 @@ #include "nvim/api/private/defs.h" #include "nvim/ascii_defs.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/event/defs.h" #include "nvim/event/loop.h" #include "nvim/event/multiqueue.h" diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c @@ -8,6 +8,7 @@ #include "auto/config.h" #include "klib/kvec.h" #include "nvim/ascii_defs.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/eval.h" #include "nvim/eval/typval_defs.h" diff --git a/src/nvim/os/signal.c b/src/nvim/os/signal.c @@ -7,6 +7,7 @@ #endif #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/eval.h" #include "nvim/event/defs.h" #include "nvim/event/signal.h" diff --git a/src/nvim/path.c b/src/nvim/path.c @@ -8,6 +8,7 @@ #include "auto/config.h" #include "nvim/ascii_defs.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cmdexpand.h" #include "nvim/eval.h" diff --git a/src/nvim/plines.c b/src/nvim/plines.c @@ -6,6 +6,7 @@ #include <string.h> #include "nvim/ascii_defs.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/decoration.h" #include "nvim/diff.h" diff --git a/src/nvim/plines.h b/src/nvim/plines.h @@ -3,9 +3,9 @@ #include <stdbool.h> #include <stdint.h> // IWYU pragma: keep -#include "nvim/buffer_defs.h" #include "nvim/marktree_defs.h" #include "nvim/pos_defs.h" // IWYU pragma: keep +#include "nvim/types_defs.h" /// Argument for lbr_chartabsize(). typedef struct { diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c @@ -38,6 +38,7 @@ #include "nvim/pos_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/vim_defs.h" diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c @@ -14,6 +14,7 @@ #include "nvim/ascii_defs.h" #include "nvim/autocmd.h" #include "nvim/buffer.h" +#include "nvim/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" diff --git a/src/nvim/quickfix.h b/src/nvim/quickfix.h @@ -1,5 +1,6 @@ #pragma once +#include "nvim/buffer_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/option_defs.h" // IWYU pragma: keep diff --git a/src/nvim/regexp_defs.h b/src/nvim/regexp_defs.h @@ -15,6 +15,32 @@ #include "nvim/pos_defs.h" #include "nvim/types_defs.h" +enum { + /// The number of sub-matches is limited to 10. + /// The first one (index 0) is the whole match, referenced with "\0". + /// The second one (index 1) is the first sub-match, referenced with "\1". + /// This goes up to the tenth (index 9), referenced with "\9". + NSUBEXP = 10, +}; + +typedef struct regengine regengine_T; + +/// Structure to be used for multi-line matching. +/// Sub-match "no" starts in line "startpos[no].lnum" column "startpos[no].col" +/// and ends in line "endpos[no].lnum" just before column "endpos[no].col". +/// The line numbers are relative to the first line, thus startpos[0].lnum is +/// always 0. +/// When there is no match, the line number is -1. +typedef struct { + regprog_T *regprog; + lpos_T startpos[NSUBEXP]; + lpos_T endpos[NSUBEXP]; + + colnr_T rmm_matchcol; ///< match start without "\zs" + int rmm_ic; + colnr_T rmm_maxcol; ///< when not zero: maximum column +} regmmatch_T; + /// Used for "magic_overruled". typedef enum { OPTION_MAGIC_NOT_SET, ///< p_magic not overruled @@ -34,14 +60,6 @@ typedef enum { } magic_T; enum { - /// The number of sub-matches is limited to 10. - /// The first one (index 0) is the whole match, referenced with "\0". - /// The second one (index 1) is the first sub-match, referenced with "\1". - /// This goes up to the tenth (index 9), referenced with "\9". - NSUBEXP = 10, -}; - -enum { /// In the NFA engine: how many braces are allowed. /// TODO(RE): Use dynamic memory allocation instead of static, like here NFA_MAX_BRACES = 20, @@ -61,28 +79,6 @@ enum { NFA_ENGINE = 2, }; -typedef struct regengine regengine_T; -typedef struct regprog regprog_T; -typedef struct reg_extmatch reg_extmatch_T; - -/// Structure to be used for multi-line matching. -/// Sub-match "no" starts in line "startpos[no].lnum" column "startpos[no].col" -/// and ends in line "endpos[no].lnum" just before column "endpos[no].col". -/// The line numbers are relative to the first line, thus startpos[0].lnum is -/// always 0. -/// When there is no match, the line number is -1. -typedef struct { - regprog_T *regprog; - lpos_T startpos[NSUBEXP]; - lpos_T endpos[NSUBEXP]; - - colnr_T rmm_matchcol; ///< match start without "\zs" - int rmm_ic; - colnr_T rmm_maxcol; ///< when not zero: maximum column -} regmmatch_T; - -#include "nvim/buffer_defs.h" - /// Structure returned by vim_regcomp() to pass on to vim_regexec(). /// This is the general structure. For the actual matcher, two specific /// structures are used. See code below. @@ -164,10 +160,10 @@ typedef struct { /// Structure used to store external references: "\z\(\)" to "\z\1". /// Use a reference count to avoid the need to copy this around. When it goes /// from 1 to zero the matches need to be freed. -struct reg_extmatch { +typedef struct { int16_t refcnt; uint8_t *matches[NSUBEXP]; -}; +} reg_extmatch_T; struct regengine { /// bt_regcomp or nfa_regcomp diff --git 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/buffer_defs.h" #include "nvim/charset.h" #include "nvim/cmdexpand.h" #include "nvim/debugger.h" diff --git a/src/nvim/shada.c b/src/nvim/shada.c @@ -50,6 +50,7 @@ #include "nvim/search.h" #include "nvim/shada.h" #include "nvim/strings.h" +#include "nvim/types_defs.h" #include "nvim/version.h" #include "nvim/vim_defs.h" diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c @@ -264,6 +264,7 @@ #include "nvim/spell_defs.h" #include "nvim/spellfile.h" #include "nvim/strings.h" +#include "nvim/types_defs.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/vim_defs.h" diff --git a/src/nvim/state.c b/src/nvim/state.c @@ -3,6 +3,7 @@ #include "nvim/ascii_defs.h" #include "nvim/autocmd.h" +#include "nvim/buffer_defs.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c @@ -40,6 +40,7 @@ #include "nvim/state_defs.h" #include "nvim/statusline.h" #include "nvim/strings.h" +#include "nvim/types_defs.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/window.h" diff --git a/src/nvim/syntax_defs.h b/src/nvim/syntax_defs.h @@ -1,6 +1,9 @@ #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 @@ -8,11 +11,6 @@ #define SST_DIST 16 // normal distance between entries #define SST_INVALID ((synstate_T *)-1) // invalid syn_state pointer -typedef struct syn_state synstate_T; - -#include "nvim/buffer_defs.h" -#include "nvim/regexp_defs.h" - // struct passed to in_id_list() struct sp_syn { int inc_tag; // ":syn include" unique tag diff --git a/src/nvim/tag.c b/src/nvim/tag.c @@ -54,6 +54,7 @@ #include "nvim/state_defs.h" #include "nvim/strings.h" #include "nvim/tag.h" +#include "nvim/types_defs.h" #include "nvim/ui.h" #include "nvim/vim_defs.h" #include "nvim/window.h" diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c @@ -49,7 +49,6 @@ #include "nvim/ascii_defs.h" #include "nvim/autocmd.h" #include "nvim/buffer.h" -#include "nvim/buffer_defs.h" #include "nvim/change.h" #include "nvim/channel.h" #include "nvim/cursor.h" diff --git a/src/nvim/terminal.h b/src/nvim/terminal.h @@ -4,13 +4,12 @@ #include <stddef.h> #include <stdint.h> -typedef struct terminal Terminal; +#include "nvim/api/private/defs.h" // IWYU pragma: keep + typedef void (*terminal_write_cb)(const char *buffer, size_t size, void *data); typedef void (*terminal_resize_cb)(uint16_t width, uint16_t height, void *data); typedef void (*terminal_close_cb)(void *data); -#include "nvim/buffer_defs.h" // IWYU pragma: keep - typedef struct { void *data; // PTY process channel uint16_t width, height; diff --git a/src/nvim/textobject.c b/src/nvim/textobject.c @@ -6,6 +6,7 @@ #include <string.h> #include "nvim/ascii_defs.h" +#include "nvim/buffer_defs.h" #include "nvim/cursor.h" #include "nvim/drawscreen.h" #include "nvim/edit.h" diff --git a/src/nvim/types_defs.h b/src/nvim/types_defs.h @@ -55,3 +55,9 @@ typedef struct { int add; // Number of signs added in the invalid range, negative for deleted signs. } SignRange; #define SIGNRANGE_INIT { 0, 0 } + +typedef struct file_buffer buf_T; +typedef struct syn_state synstate_T; +typedef struct terminal Terminal; +typedef struct window_S win_T; +typedef struct regprog regprog_T; diff --git a/src/nvim/ui_compositor.c b/src/nvim/ui_compositor.c @@ -14,6 +14,7 @@ #include "klib/kvec.h" #include "nvim/api/private/defs.h" #include "nvim/ascii_defs.h" +#include "nvim/buffer_defs.h" #include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" diff --git a/src/nvim/undo_defs.h b/src/nvim/undo_defs.h @@ -18,8 +18,6 @@ typedef struct { colnr_T vi_curswant; ///< MAXCOL from w_curswant } visualinfo_T; -#include "nvim/buffer_defs.h" - typedef struct u_entry u_entry_T; struct u_entry { u_entry_T *ue_next; ///< pointer to next entry in list diff --git a/src/nvim/usercmd.h b/src/nvim/usercmd.h @@ -3,6 +3,7 @@ #include <stddef.h> // IWYU pragma: keep #include <stdint.h> +#include "nvim/api/private/defs.h" // IWYU pragma: keep #include "nvim/cmdexpand_defs.h" // IWYU pragma: keep #include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" diff --git a/src/nvim/version.h b/src/nvim/version.h @@ -1,5 +1,6 @@ #pragma once +#include "nvim/api/private/defs.h" // IWYU pragma: keep #include "nvim/ex_cmds_defs.h" // IWYU pragma: keep #include "nvim/macros_defs.h" diff --git a/src/nvim/vim_defs.h b/src/nvim/vim_defs.h @@ -1,13 +1,14 @@ #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 #define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim" #define RUNTIME_DIRNAME "runtime" -#include "auto/config.h" - enum { /// length of a buffer to store a number in ASCII (64 bits binary + NUL) NUMBUFLEN = 65, @@ -56,8 +57,6 @@ typedef enum { kCdCauseAuto, ///< On 'autochdir'. } CdCause; -#include "nvim/os/os_defs.h" // IWYU pragma: keep - // return values for functions #if !(defined(OK) && (OK == 1)) // OK already defined to 1 in MacOS X curses, skip this diff --git a/src/nvim/winfloat.c b/src/nvim/winfloat.c @@ -19,6 +19,7 @@ #include "nvim/optionstr.h" #include "nvim/pos_defs.h" #include "nvim/strings.h" +#include "nvim/types_defs.h" #include "nvim/ui.h" #include "nvim/vim_defs.h" #include "nvim/window.h"