aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
parentf4001d27efae44c6c07678ad2c72eed5f1a25ea8 (diff)
downloadrneovim-a6cba103cebce535279db197f9efeb34e9d1171f.tar.gz
rneovim-a6cba103cebce535279db197f9efeb34e9d1171f.tar.bz2
rneovim-a6cba103cebce535279db197f9efeb34e9d1171f.zip
refactor: move some constants out of vim_defs.h (#26298)
Diffstat (limited to 'src')
-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
84 files changed, 329 insertions, 333 deletions
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/runtime.h"
+#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/types_defs.h"
#include "nvim/vim_defs.h"
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 5b90231a62..e0887ed1d0 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -21,6 +21,7 @@
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
#include "nvim/fold.h"
+#include "nvim/fold_defs.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
#include "nvim/highlight.h"
@@ -48,8 +49,7 @@
#include "nvim/ui.h"
#include "nvim/vim_defs.h"
-#define MB_FILLER_CHAR '<' // character used when a double-width character
- // doesn't fit.
+#define MB_FILLER_CHAR '<' // character used when a double-width character doesn't fit.
/// possible draw states in win_line(), drawn in sequence.
typedef enum {
diff --git a/src/nvim/drawline.h b/src/nvim/drawline.h
index 6a9c6d5597..5a7f220a13 100644
--- a/src/nvim/drawline.h
+++ b/src/nvim/drawline.h
@@ -5,7 +5,7 @@
#include "klib/kvec.h"
#include "nvim/decoration_provider.h"
-#include "nvim/fold.h"
+#include "nvim/fold_defs.h"
#include "nvim/macros_defs.h"
#include "nvim/pos_defs.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 77065f95e9..71a12ea1b0 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -29,7 +29,7 @@
#include "nvim/gettext.h"
#include "nvim/globals.h"
#include "nvim/grid.h"
-#include "nvim/highlight_defs.h"
+#include "nvim/highlight.h"
#include "nvim/highlight_group.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
diff --git a/src/nvim/eval.h b/src/nvim/eval.h
index b8104cf82a..1fc2891917 100644
--- a/src/nvim/eval.h
+++ b/src/nvim/eval.h
@@ -277,6 +277,9 @@ enum {
EVAL_EVALUATE = 1, ///< when missing don't actually evaluate
};
+// Character used as separated in autoload function/variable names.
+#define AUTOLOAD_CHAR '#'
+
/// Passed to an eval() function to enable evaluation.
EXTERN evalarg_T EVALARG_EVALUATE INIT( = { EVAL_EVALUATE, NULL, NULL, NULL });
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index 6355dd6b93..55f4721c3a 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -6198,8 +6198,8 @@ M.funcs = {
"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()|.
@@ -6287,8 +6287,8 @@ M.funcs = {
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/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 974631d61f..e369397047 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -48,7 +48,7 @@
#include "nvim/gettext.h"
#include "nvim/globals.h"
#include "nvim/help.h"
-#include "nvim/highlight_defs.h"
+#include "nvim/highlight.h"
#include "nvim/highlight_group.h"
#include "nvim/indent.h"
#include "nvim/input.h"
@@ -79,6 +79,7 @@
#include "nvim/regexp.h"
#include "nvim/search.h"
#include "nvim/spell.h"
+#include "nvim/state_defs.h"
#include "nvim/strings.h"
#include "nvim/terminal.h"
#include "nvim/types_defs.h"
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index a00124ea30..1722b7902b 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -26,7 +26,7 @@
#include "nvim/fileio.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"
-#include "nvim/highlight_defs.h"
+#include "nvim/highlight.h"
#include "nvim/macros_defs.h"
#include "nvim/mark.h"
#include "nvim/memory.h"
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 381e23b27d..0b466bbe4e 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -44,7 +44,7 @@
#include "nvim/getchar.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"
-#include "nvim/highlight_defs.h"
+#include "nvim/highlight.h"
#include "nvim/highlight_group.h"
#include "nvim/input.h"
#include "nvim/keycodes.h"
diff --git a/src/nvim/ex_docmd.h b/src/nvim/ex_docmd.h
index 3781ba1a34..698153e8df 100644
--- a/