diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2023-11-29 20:32:40 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-29 20:32:40 +0800 |
| commit | a6cba103cebce535279db197f9efeb34e9d1171f (patch) | |
| tree | 17a8d9b4ecabf8e2c02c07e18b81c85f2e7c429f | |
| parent | f4001d27efae44c6c07678ad2c72eed5f1a25ea8 (diff) | |
| download | rneovim-a6cba103cebce535279db197f9efeb34e9d1171f.tar.gz rneovim-a6cba103cebce535279db197f9efeb34e9d1171f.tar.bz2 rneovim-a6cba103cebce535279db197f9efeb34e9d1171f.zip | |
refactor: move some constants out of vim_defs.h (#26298)
89 files changed, 339 insertions, 352 deletions
@@ -143,7 +143,6 @@ iwyu: build/.ran-cmake cmake --build build > build/iwyu.log iwyu-fix-includes --only_re="src/nvim" --ignore_re="(src/nvim/eval/encode.c|src/nvim/auto/|src/nvim/os/lang.c|src/nvim/map.c\ |src/nvim/api/extmark.h\ - |src/nvim/api/private/defs.h\ |src/nvim/api/private/dispatch.h\ |src/nvim/api/private/helpers.h\ |src/nvim/api/private/validate.h\ @@ -154,14 +153,11 @@ iwyu: build/.ran-cmake |src/nvim/autocmd_defs.h\ |src/nvim/buffer.h\ |src/nvim/buffer_defs.h\ - |src/nvim/buffer_updates.h\ |src/nvim/channel.h\ |src/nvim/charset.h\ |src/nvim/cmdexpand.h\ |src/nvim/cmdhist.h\ - |src/nvim/context.h\ |src/nvim/decoration.h\ - |src/nvim/decoration_provider.h\ |src/nvim/diff.h\ |src/nvim/drawline.h\ |src/nvim/drawscreen.h\ @@ -169,7 +165,6 @@ iwyu: build/.ran-cmake |src/nvim/eval/encode.h\ |src/nvim/eval/typval.h\ |src/nvim/eval/typval_defs.h\ - |src/nvim/eval/typval_encode.h\ |src/nvim/eval/userfunc.h\ |src/nvim/eval/window.h\ |src/nvim/event/libuv_process.h\ @@ -185,7 +180,6 @@ iwyu: build/.ran-cmake |src/nvim/ex_cmds.h\ |src/nvim/ex_cmds_defs.h\ |src/nvim/ex_docmd.h\ - |src/nvim/ex_getln.h\ |src/nvim/extmark.h\ |src/nvim/file_search.h\ |src/nvim/fileio.h\ @@ -203,15 +197,12 @@ iwyu: build/.ran-cmake |src/nvim/lua/executor.h\ |src/nvim/main.h\ |src/nvim/mark.h\ - |src/nvim/marktree.h\ - |src/nvim/message.h\ |src/nvim/mouse.h\ |src/nvim/move.h\ |src/nvim/msgpack_rpc/channel.h\ |src/nvim/msgpack_rpc/channel_defs.h\ |src/nvim/msgpack_rpc/helpers.h\ |src/nvim/msgpack_rpc/unpacker.h\ - |src/nvim/ops.h\ |src/nvim/option.h\ |src/nvim/os/fileio.h\ |src/nvim/os/input.h\ diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 349bb93133..6ffb514487 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -4189,8 +4189,8 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* "mode_bits" Nvim's internal binary representation of "mode". |mapset()| ignores this; only "mode" is used. See |maplist()| for usage examples. The values - are from src/nvim/vim.h and may change in the - future. + are from src/nvim/state_defs.h and may change in + the future. The dictionary can be used to restore a mapping with |mapset()|. @@ -4257,8 +4257,8 @@ maplist([{abbr}]) *maplist()* endfor echo saved_maps->mapnew({_, m -> m.lhs}) < The values of the mode_bits are defined in Nvim's - src/nvim/vim.h file and they can be discovered at runtime - using |:map-commands| and "maplist()". Example: >vim + src/nvim/state_defs.h file and they can be discovered at + runtime using |:map-commands| and "maplist()". Example: >vim omap xyzzy <Nop> let op_bit = maplist()->filter( \ {_, m -> m.lhs == 'xyzzy'})[0].mode_bits diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 947424c4ad..05e5b2b871 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -5050,8 +5050,8 @@ function vim.fn.map(expr1, expr2) end --- "mode_bits" Nvim's internal binary representation of "mode". --- |mapset()| ignores this; only "mode" is used. --- See |maplist()| for usage examples. The values ---- are from src/nvim/vim.h and may change in the ---- future. +--- are from src/nvim/state_defs.h and may change in +--- the future. --- --- The dictionary can be used to restore a mapping with --- |mapset()|. @@ -5129,8 +5129,8 @@ function vim.fn.mapcheck(name, mode, abbr) end --- endfor --- echo saved_maps->mapnew({_, m -> m.lhs}) --- <The values of the mode_bits are defined in Nvim's ---- src/nvim/vim.h file and they can be discovered at runtime ---- using |:map-commands| and "maplist()". Example: >vim +--- src/nvim/state_defs.h file and they can be discovered at +--- runtime using |:map-commands| and "maplist()". Example: >vim --- omap xyzzy <Nop> --- let op_bit = maplist()->filter( --- \ {_, m -> m.lhs == 'xyzzy'})[0].mode_bits diff --git a/src/clint.py b/src/clint.py index ef2ac57a87..e730b9276b 100755 --- a/src/clint.py +++ b/src/clint.py @@ -898,7 +898,6 @@ def CheckIncludes(filename, lines, error): # the Makefile. check_includes_ignore = [ "src/nvim/api/extmark.h", - "src/nvim/api/private/defs.h", "src/nvim/api/private/dispatch.h", "src/nvim/api/private/helpers.h", "src/nvim/api/private/validate.h", @@ -909,14 +908,11 @@ def CheckIncludes(filename, lines, error): "src/nvim/autocmd_defs.h", "src/nvim/buffer.h", "src/nvim/buffer_defs.h", - "src/nvim/buffer_updates.h", "src/nvim/channel.h", "src/nvim/charset.h", "src/nvim/cmdexpand.h", "src/nvim/cmdhist.h", - "src/nvim/context.h", "src/nvim/decoration.h", - "src/nvim/decoration_provider.h", "src/nvim/diff.h", "src/nvim/drawline.h", "src/nvim/drawscreen.h", @@ -924,7 +920,6 @@ def CheckIncludes(filename, lines, error): "src/nvim/eval/encode.h", "src/nvim/eval/typval.h", "src/nvim/eval/typval_defs.h", - "src/nvim/eval/typval_encode.h", "src/nvim/eval/userfunc.h", "src/nvim/eval/window.h", "src/nvim/event/libuv_process.h", @@ -940,7 +935,6 @@ def CheckIncludes(filename, lines, error): "src/nvim/ex_cmds.h", "src/nvim/ex_cmds_defs.h", "src/nvim/ex_docmd.h", - "src/nvim/ex_getln.h", "src/nvim/extmark.h", "src/nvim/file_search.h", "src/nvim/fileio.h", @@ -958,15 +952,12 @@ def CheckIncludes(filename, lines, error): "src/nvim/lua/executor.h", "src/nvim/main.h", "src/nvim/mark.h", - "src/nvim/marktree.h", - "src/nvim/message.h", "src/nvim/mouse.h", "src/nvim/move.h", "src/nvim/msgpack_rpc/channel.h", "src/nvim/msgpack_rpc/channel_defs.h", "src/nvim/msgpack_rpc/helpers.h", "src/nvim/msgpack_rpc/unpacker.h", - "src/nvim/ops.h", "src/nvim/option.h", "src/nvim/os/fileio.h", "src/nvim/os/input.h", diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 96e0e240f2..0df231868d 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -34,6 +34,7 @@ #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/vim_defs.h" diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index 585fac1228..74a1dbdbc3 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -29,7 +29,7 @@ #include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/hashtab.h" -#include "nvim/highlight_defs.h" +#include "nvim/highlight.h" #include "nvim/insexpand.h" #include "nvim/lua/executor.h" #include "nvim/main.h" diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index e6bedca232..8a594dea92 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -89,8 +89,8 @@ #include "nvim/regexp.h" #include "nvim/runtime.h" #include "nvim/search.h" -#include "nvim/sign.h" #include "nvim/spell.h" +#include "nvim/state_defs.h" #include "nvim/statusline.h" #include "nvim/strings.h" #include "nvim/syntax.h" diff --git a/src/nvim/buffer_updates.c b/src/nvim/buffer_updates.c index 6a96f715af..01bcb9d7be 100644 --- a/src/nvim/buffer_updates.c +++ b/src/nvim/buffer_updates.c @@ -11,7 +11,6 @@ #include "nvim/buffer.h" #include "nvim/buffer_defs.h" #include "nvim/buffer_updates.h" -#include "nvim/extmark.h" #include "nvim/func_attr.h" #include "nvim/globals.h" #include "nvim/log.h" diff --git a/src/nvim/buffer_updates.h b/src/nvim/buffer_updates.h index ca5246c571..e844f3b2a8 100644 --- a/src/nvim/buffer_updates.h +++ b/src/nvim/buffer_updates.h @@ -3,8 +3,8 @@ #include <stdint.h> // IWYU pragma: keep #include "nvim/buffer_defs.h" // IWYU pragma: keep -#include "nvim/extmark.h" -#include "nvim/pos_defs.h" +#include "nvim/extmark_defs.h" // IWYU pragma: keep +#include "nvim/pos_defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS # include "buffer_updates.h.generated.h" diff --git a/src/nvim/bufwrite.c b/src/nvim/bufwrite.c index 178218729a..f774fcb057 100644 --- a/src/nvim/bufwrite.c +++ b/src/nvim/bufwrite.c @@ -26,7 +26,7 @@ #include "nvim/func_attr.h" #include "nvim/gettext.h" #include "nvim/globals.h" -#include "nvim/highlight_defs.h" +#include "nvim/highlight.h" #include "nvim/iconv_defs.h" #include "nvim/input.h" #include "nvim/macros_defs.h" diff --git a/src/nvim/change.c b/src/nvim/change.c index 20cc034638..81a55b92ee 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -24,7 +24,7 @@ #include "nvim/func_attr.h" #include "nvim/gettext.h" #include "nvim/globals.h" -#include "nvim/highlight_defs.h" +#include "nvim/highlight.h" #include "nvim/indent.h" #include "nvim/indent_c.h" #include "nvim/insexpand.h" diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index 275b284392..367b86ec55 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -35,7 +35,7 @@ #include "nvim/grid.h" #include "nvim/hashtab.h" #include "nvim/help.h" -#include "nvim/highlight_defs.h" +#include "nvim/highlight.h" #include "nvim/highlight_group.h" #include "nvim/keycodes.h" #include "nvim/log.h" diff --git a/src/nvim/context.h b/src/nvim/context.h index f39399e806..1c18a1af7c 100644 --- a/src/nvim/context.h +++ b/src/nvim/context.h @@ -1,6 +1,5 @@ #pragma once -#include <msgpack.h> #include <msgpack/sbuffer.h> #include <stddef.h> diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c index 82068ce9c5..745c0cc6ed 100644 --- a/src/nvim/cursor_shape.c +++ b/src/nvim/cursor_shape.c @@ -15,6 +15,7 @@ #include "nvim/log.h" #include "nvim/macros_defs.h" #include "nvim/option_vars.h" +#include "nvim/state_defs.h" #include "nvim/strings.h" #include "nvim/ui.h" #include "nvim/vim_defs.h" diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c index dd248ca58e..a343c1ad6b 100644 --- a/src/nvim/debugger.c +++ b/src/nvim/debugger.c @@ -32,6 +32,7 @@ #include "nvim/pos_defs.h" #include "nvim/regexp.h" #include "nvim/runtime.h" +#include "nvim/state_defs.h" #include "nvim/vim_defs.h" /// batch mode debugging: don't save and restore typeahead. diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h index 829046f1b9..f5448c051b 100644 --- a/src/nvim/decoration.h +++ b/src/nvim/decoration.h @@ -1,16 +1,15 @@ #pragma once #include <stdbool.h> -#include <stddef.h> +#include <stddef.h> // IWYU pragma: keep #include <stdint.h> #include "klib/kvec.h" #include "nvim/buffer_defs.h" #include "nvim/decoration_defs.h" // IWYU pragma: export -#include "nvim/extmark_defs.h" #include "nvim/macros_defs.h" #include "nvim/marktree.h" -#include "nvim/pos_defs.h" +#include "nvim/pos_defs.h" // IWYU pragma: keep #include "nvim/types_defs.h" // actual Decor* data is in decoration_defs.h diff --git a/src/nvim/decoration_provider.h b/src/nvim/decoration_provider.h index 90bd9e6a41..e0dd67a6f7 100644 --- a/src/nvim/decoration_provider.h +++ b/src/nvim/decoration_provider.h @@ -4,7 +4,7 @@ #include <stdint.h> #include "klib/kvec.h" -#include "nvim/buffer_defs.h" +#include "nvim/buffer_defs.h" // IWYU pragma: keep #include "nvim/macros_defs.h" #include "nvim/types_defs.h" diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index 647ab26441..99d5cf1035 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -22,7 +22,7 @@ #include "nvim/getchar.h" #include "nvim/gettext.h" #include "nvim/globals.h" -#include "nvim/highlight_defs.h" +#include "nvim/highlight.h" #include "nvim/keycodes.h" #include "nvim/mapping.h" #include "nvim/mbyte.h" @@ -32,6 +32,7 @@ #include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/ru |