aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-29 20:32:40 +0800
committerGitHub <noreply@github.com>2023-11-29 20:32:40 +0800
commita6cba103cebce535279db197f9efeb34e9d1171f (patch)
tree17a8d9b4ecabf8e2c02c07e18b81c85f2e7c429f
parentf4001d27efae44c6c07678ad2c72eed5f1a25ea8 (diff)
downloadrneovim-a6cba103cebce535279db197f9efeb34e9d1171f.tar.gz
rneovim-a6cba103cebce535279db197f9efeb34e9d1171f.tar.bz2
rneovim-a6cba103cebce535279db197f9efeb34e9d1171f.zip
refactor: move some constants out of vim_defs.h (#26298)
-rw-r--r--Makefile9
-rw-r--r--runtime/doc/builtin.txt8
-rw-r--r--runtime/lua/vim/_meta/vimfn.lua8
-rwxr-xr-xsrc/clint.py9
-rw-r--r--src/nvim/api/buffer.c1
-rw-r--r--src/nvim/autocmd.c2
-rw-r--r--src/nvim/buffer.c2
-rw-r--r--src/nvim/buffer_updates.c1
-rw-r--r--src/nvim/buffer_updates.h4
-rw-r--r--src/nvim/bufwrite.c2
-rw-r--r--src/nvim/change.c2
-rw-r--r--src/nvim/cmdexpand.c2
-rw-r--r--src/nvim/context.h1
-rw-r--r--src/nvim/cursor_shape.c1
-rw-r--r--src/nvim/debugger.c1
-rw-r--r--src/nvim/decoration.h5
-rw-r--r--src/nvim/decoration_provider.h2
-rw-r--r--src/nvim/digraph.c3
-rw-r--r--src/nvim/drawline.c4
-rw-r--r--src/nvim/drawline.h2
-rw-r--r--src/nvim/edit.c2
-rw-r--r--src/nvim/eval.h3
-rw-r--r--src/nvim/eval.lua8
-rw-r--r--src/nvim/ex_cmds.c3
-rw-r--r--src/nvim/ex_cmds2.c2
-rw-r--r--src/nvim/ex_docmd.c2
-rw-r--r--src/nvim/ex_docmd.h2
-rw-r--r--src/nvim/ex_getln.c2
-rw-r--r--src/nvim/ex_getln.h2
-rw-r--r--src/nvim/extmark.c1
-rw-r--r--src/nvim/extmark.h3
-rw-r--r--src/nvim/extmark_defs.h3
-rw-r--r--src/nvim/fileio.c3
-rw-r--r--src/nvim/fold.c1
-rw-r--r--src/nvim/fold_defs.h15
-rw-r--r--src/nvim/globals.h1
-rw-r--r--src/nvim/grid.c1
-rw-r--r--src/nvim/highlight.h3
-rw-r--r--src/nvim/indent.c5
-rw-r--r--src/nvim/indent_c.c1
-rw-r--r--src/nvim/input.c4
-rw-r--r--src/nvim/insexpand.c2
-rw-r--r--src/nvim/lua/converter.c6
-rw-r--r--src/nvim/main.c5
-rw-r--r--src/nvim/mapping.c3
-rw-r--r--src/nvim/mapping_defs.h3
-rw-r--r--src/nvim/mark.c2
-rw-r--r--src/nvim/marktree.h11
-rw-r--r--src/nvim/mbyte_defs.h5
-rw-r--r--src/nvim/memfile.h9
-rw-r--r--src/nvim/memline.c44
-rw-r--r--src/nvim/memory.c1
-rw-r--r--src/nvim/menu.c2
-rw-r--r--src/nvim/message.c1
-rw-r--r--src/nvim/message.h22
-rw-r--r--src/nvim/normal.c2
-rw-r--r--src/nvim/normal_defs.h6
-rw-r--r--src/nvim/ops.c8
-rw-r--r--src/nvim/ops.h124
-rw-r--r--src/nvim/option.c1
-rw-r--r--src/nvim/os/input.c1
-rw-r--r--src/nvim/os/os_defs.h2
-rw-r--r--src/nvim/os/os_win_console.c4
-rw-r--r--src/nvim/os/shell.c1
-rw-r--r--src/nvim/os/users.c3
-rw-r--r--src/nvim/plines.c1
-rw-r--r--src/nvim/popupmenu.c1
-rw-r--r--src/nvim/quickfix.c4
-rw-r--r--src/nvim/runtime.c5
-rw-r--r--src/nvim/search.c4
-rw-r--r--src/nvim/sign.c2
-rw-r--r--src/nvim/state.h10
-rw-r--r--src/nvim/state_defs.h45
-rw-r--r--src/nvim/statusline.c1
-rw-r--r--src/nvim/syntax.c2
-rw-r--r--src/nvim/tag.c3
-rw-r--r--src/nvim/tag.h2
-rw-r--r--src/nvim/textformat.c1
-rw-r--r--src/nvim/ui.c2
-rw-r--r--src/nvim/ui_compositor.c1
-rw-r--r--src/nvim/undo.c2
-rw-r--r--src/nvim/undo_defs.h71
-rw-r--r--src/nvim/usercmd.c2
-rw-r--r--src/nvim/version.c2
-rw-r--r--src/nvim/vim_defs.h111
-rw-r--r--src/nvim/viml/parser/expressions.c2
-rw-r--r--src/nvim/window.h9
-rw-r--r--test/functional/api/keymap_spec.lua2
-rw-r--r--test/functional/api/server_requests_spec.lua2
89 files changed, 339 insertions, 352 deletions
diff --git a/Makefile b/Makefile
index b1c39d5816..c6a0c053ea 100644
--- a/Makefile
+++ b/Makefile
@@ -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