mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 02:34:59 -07:00
refactor: fix runtime_defs.h (#26259)
This commit is contained in:
parent
6c14ae6bfa
commit
718053b7a9
40
Makefile
40
Makefile
@ -142,20 +142,12 @@ iwyu: build/.ran-cmake
|
||||
cmake --preset iwyu
|
||||
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/buffer.h\
|
||||
|src/nvim/api/command.h\
|
||||
|src/nvim/api/extmark.h\
|
||||
|src/nvim/api/options.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\
|
||||
|src/nvim/api/ui.h\
|
||||
|src/nvim/api/vim.h\
|
||||
|src/nvim/api/vimscript.h\
|
||||
|src/nvim/api/win_config.h\
|
||||
|src/nvim/api/window.h\
|
||||
|src/nvim/arglist.h\
|
||||
|src/nvim/ascii.h\
|
||||
|src/nvim/assert.h\
|
||||
|src/nvim/autocmd.h\
|
||||
@ -163,28 +155,19 @@ iwyu: build/.ran-cmake
|
||||
|src/nvim/buffer.h\
|
||||
|src/nvim/buffer_defs.h\
|
||||
|src/nvim/buffer_updates.h\
|
||||
|src/nvim/bufwrite.h\
|
||||
|src/nvim/change.h\
|
||||
|src/nvim/channel.h\
|
||||
|src/nvim/charset.h\
|
||||
|src/nvim/cmdexpand.h\
|
||||
|src/nvim/cmdexpand_defs.h\
|
||||
|src/nvim/cmdhist.h\
|
||||
|src/nvim/context.h\
|
||||
|src/nvim/cursor.h\
|
||||
|src/nvim/decoration.h\
|
||||
|src/nvim/decoration_defs.h\
|
||||
|src/nvim/decoration_provider.h\
|
||||
|src/nvim/diff.h\
|
||||
|src/nvim/digraph.h\
|
||||
|src/nvim/drawline.h\
|
||||
|src/nvim/drawscreen.h\
|
||||
|src/nvim/edit.h\
|
||||
|src/nvim/eval.h\
|
||||
|src/nvim/eval/buffer.h\
|
||||
|src/nvim/eval/decode.h\
|
||||
|src/nvim/eval/encode.h\
|
||||
|src/nvim/eval/funcs.h\
|
||||
|src/nvim/eval/typval.h\
|
||||
|src/nvim/eval/typval_defs.h\
|
||||
|src/nvim/eval/typval_encode.h\
|
||||
@ -204,46 +187,34 @@ iwyu: build/.ran-cmake
|
||||
|src/nvim/ex_cmds.h\
|
||||
|src/nvim/ex_cmds_defs.h\
|
||||
|src/nvim/ex_docmd.h\
|
||||
|src/nvim/ex_eval_defs.h\
|
||||
|src/nvim/ex_getln.h\
|
||||
|src/nvim/extmark.h\
|
||||
|src/nvim/extmark_defs.h\
|
||||
|src/nvim/file_search.h\
|
||||
|src/nvim/fileio.h\
|
||||
|src/nvim/fold.h\
|
||||
|src/nvim/fold_defs.h\
|
||||
|src/nvim/garray.h\
|
||||
|src/nvim/getchar.h\
|
||||
|src/nvim/globals.h\
|
||||
|src/nvim/grid.h\
|
||||
|src/nvim/grid_defs.h\
|
||||
|src/nvim/hashtab.h\
|
||||
|src/nvim/highlight.h\
|
||||
|src/nvim/highlight_defs.h\
|
||||
|src/nvim/highlight_group.h\
|
||||
|src/nvim/indent.h\
|
||||
|src/nvim/indent_c.h\
|
||||
|src/nvim/input.h\
|
||||
|src/nvim/insexpand.h\
|
||||
|src/nvim/keycodes.h\
|
||||
|src/nvim/linematch.h\
|
||||
|src/nvim/log.h\
|
||||
|src/nvim/lua/executor.h\
|
||||
|src/nvim/macros.h\
|
||||
|src/nvim/main.h\
|
||||
|src/nvim/map.h\
|
||||
|src/nvim/mapping.h\
|
||||
|src/nvim/mapping_defs.h\
|
||||
|src/nvim/mark.h\
|
||||
|src/nvim/mark_defs.h\
|
||||
|src/nvim/marktree.h\
|
||||
|src/nvim/match.h\
|
||||
|src/nvim/mbyte.h\
|
||||
|src/nvim/mbyte_defs.h\
|
||||
|src/nvim/memfile_defs.h\
|
||||
|src/nvim/memline.h\
|
||||
|src/nvim/memory.h\
|
||||
|src/nvim/menu.h\
|
||||
|src/nvim/message.h\
|
||||
|src/nvim/mouse.h\
|
||||
|src/nvim/move.h\
|
||||
@ -254,31 +225,22 @@ iwyu: build/.ran-cmake
|
||||
|src/nvim/normal.h\
|
||||
|src/nvim/ops.h\
|
||||
|src/nvim/option.h\
|
||||
|src/nvim/option_defs.h\
|
||||
|src/nvim/option_vars.h\
|
||||
|src/nvim/os/fileio.h\
|
||||
|src/nvim/os/fs.h\
|
||||
|src/nvim/os/input.h\
|
||||
|src/nvim/os/lang.h\
|
||||
|src/nvim/os/pty_conpty_win.h\
|
||||
|src/nvim/os/pty_process_unix.h\
|
||||
|src/nvim/os/pty_process_win.h\
|
||||
|src/nvim/path.h\
|
||||
|src/nvim/plines.h\
|
||||
|src/nvim/popupmenu.h\
|
||||
|src/nvim/profile.h\
|
||||
|src/nvim/quickfix.h\
|
||||
|src/nvim/regexp.h\
|
||||
|src/nvim/regexp_defs.h\
|
||||
|src/nvim/search.h\
|
||||
|src/nvim/sign.h\
|
||||
|src/nvim/spell.h\
|
||||
|src/nvim/spell_defs.h\
|
||||
|src/nvim/statusline.h\
|
||||
|src/nvim/statusline_defs.h\
|
||||
|src/nvim/strings.h\
|
||||
|src/nvim/syntax.h\
|
||||
|src/nvim/testing.h\
|
||||
|src/nvim/textformat.h\
|
||||
|src/nvim/textobject.h\
|
||||
|src/nvim/tui/input.h\
|
||||
@ -287,8 +249,6 @@ iwyu: build/.ran-cmake
|
||||
|src/nvim/ui.h\
|
||||
|src/nvim/ui_client.h\
|
||||
|src/nvim/ui_compositor.h\
|
||||
|src/nvim/undo.h\
|
||||
|src/nvim/usercmd.h\
|
||||
|src/nvim/version.h\
|
||||
|src/nvim/vim.h\
|
||||
|src/nvim/viml/parser/expressions.h\
|
||||
|
40
src/clint.py
40
src/clint.py
@ -897,20 +897,12 @@ def CheckIncludes(filename, lines, error):
|
||||
# These should be synced with the ignored headers in the `iwyu` target in
|
||||
# the Makefile.
|
||||
check_includes_ignore = [
|
||||
"src/nvim/api/buffer.h",
|
||||
"src/nvim/api/command.h",
|
||||
"src/nvim/api/extmark.h",
|
||||
"src/nvim/api/options.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",
|
||||
"src/nvim/api/ui.h",
|
||||
"src/nvim/api/vim.h",
|
||||
"src/nvim/api/vimscript.h",
|
||||
"src/nvim/api/win_config.h",
|
||||
"src/nvim/api/window.h",
|
||||
"src/nvim/arglist.h",
|
||||
"src/nvim/ascii.h",
|
||||
"src/nvim/assert.h",
|
||||
"src/nvim/autocmd.h",
|
||||
@ -918,28 +910,19 @@ def CheckIncludes(filename, lines, error):
|
||||
"src/nvim/buffer.h",
|
||||
"src/nvim/buffer_defs.h",
|
||||
"src/nvim/buffer_updates.h",
|
||||
"src/nvim/bufwrite.h",
|
||||
"src/nvim/change.h",
|
||||
"src/nvim/channel.h",
|
||||
"src/nvim/charset.h",
|
||||
"src/nvim/cmdexpand.h",
|
||||
"src/nvim/cmdexpand_defs.h",
|
||||
"src/nvim/cmdhist.h",
|
||||
"src/nvim/context.h",
|
||||
"src/nvim/cursor.h",
|
||||
"src/nvim/decoration.h",
|
||||
"src/nvim/decoration_defs.h",
|
||||
"src/nvim/decoration_provider.h",
|
||||
"src/nvim/diff.h",
|
||||
"src/nvim/digraph.h",
|
||||
"src/nvim/drawline.h",
|
||||
"src/nvim/drawscreen.h",
|
||||
"src/nvim/edit.h",
|
||||
"src/nvim/eval.h",
|
||||
"src/nvim/eval/buffer.h",
|
||||
"src/nvim/eval/decode.h",
|
||||
"src/nvim/eval/encode.h",
|
||||
"src/nvim/eval/funcs.h",
|
||||
"src/nvim/eval/typval.h",
|
||||
"src/nvim/eval/typval_defs.h",
|
||||
"src/nvim/eval/typval_encode.h",
|
||||
@ -959,46 +942,34 @@ def CheckIncludes(filename, lines, error):
|
||||
"src/nvim/ex_cmds.h",
|
||||
"src/nvim/ex_cmds_defs.h",
|
||||
"src/nvim/ex_docmd.h",
|
||||
"src/nvim/ex_eval_defs.h",
|
||||
"src/nvim/ex_getln.h",
|
||||
"src/nvim/extmark.h",
|
||||
"src/nvim/extmark_defs.h",
|
||||
"src/nvim/file_search.h",
|
||||
"src/nvim/fileio.h",
|
||||
"src/nvim/fold.h",
|
||||
"src/nvim/fold_defs.h",
|
||||
"src/nvim/garray.h",
|
||||
"src/nvim/getchar.h",
|
||||
"src/nvim/globals.h",
|
||||
"src/nvim/grid.h",
|
||||
"src/nvim/grid_defs.h",
|
||||
"src/nvim/hashtab.h",
|
||||
"src/nvim/highlight.h",
|
||||
"src/nvim/highlight_defs.h",
|
||||
"src/nvim/highlight_group.h",
|
||||
"src/nvim/indent.h",
|
||||
"src/nvim/indent_c.h",
|
||||
"src/nvim/input.h",
|
||||
"src/nvim/insexpand.h",
|
||||
"src/nvim/keycodes.h",
|
||||
"src/nvim/linematch.h",
|
||||
"src/nvim/log.h",
|
||||
"src/nvim/lua/executor.h",
|
||||
"src/nvim/macros.h",
|
||||
"src/nvim/main.h",
|
||||
"src/nvim/map.h",
|
||||
"src/nvim/mapping.h",
|
||||
"src/nvim/mapping_defs.h",
|
||||
"src/nvim/mark.h",
|
||||
"src/nvim/mark_defs.h",
|
||||
"src/nvim/marktree.h",
|
||||
"src/nvim/match.h",
|
||||
"src/nvim/mbyte.h",
|
||||
"src/nvim/mbyte_defs.h",
|
||||
"src/nvim/memfile_defs.h",
|
||||
"src/nvim/memline.h",
|
||||
"src/nvim/memory.h",
|
||||
"src/nvim/menu.h",
|
||||
"src/nvim/message.h",
|
||||
"src/nvim/mouse.h",
|
||||
"src/nvim/move.h",
|
||||
@ -1009,31 +980,22 @@ def CheckIncludes(filename, lines, error):
|
||||
"src/nvim/normal.h",
|
||||
"src/nvim/ops.h",
|
||||
"src/nvim/option.h",
|
||||
"src/nvim/option_defs.h",
|
||||
"src/nvim/option_vars.h",
|
||||
"src/nvim/os/fileio.h",
|
||||
"src/nvim/os/fs.h",
|
||||
"src/nvim/os/input.h",
|
||||
"src/nvim/os/lang.h",
|
||||
"src/nvim/os/pty_conpty_win.h",
|
||||
"src/nvim/os/pty_process_unix.h",
|
||||
"src/nvim/os/pty_process_win.h",
|
||||
"src/nvim/path.h",
|
||||
"src/nvim/plines.h",
|
||||
"src/nvim/popupmenu.h",
|
||||
"src/nvim/profile.h",
|
||||
"src/nvim/quickfix.h",
|
||||
"src/nvim/regexp.h",
|
||||
"src/nvim/regexp_defs.h",
|
||||
"src/nvim/search.h",
|
||||
"src/nvim/sign.h",
|
||||
"src/nvim/spell.h",
|
||||
"src/nvim/spell_defs.h",
|
||||
"src/nvim/statusline.h",
|
||||
"src/nvim/statusline_defs.h",
|
||||
"src/nvim/strings.h",
|
||||
"src/nvim/syntax.h",
|
||||
"src/nvim/testing.h",
|
||||
"src/nvim/textformat.h",
|
||||
"src/nvim/textobject.h",
|
||||
"src/nvim/tui/input.h",
|
||||
@ -1042,8 +1004,6 @@ def CheckIncludes(filename, lines, error):
|
||||
"src/nvim/ui.h",
|
||||
"src/nvim/ui_client.h",
|
||||
"src/nvim/ui_compositor.h",
|
||||
"src/nvim/undo.h",
|
||||
"src/nvim/usercmd.h",
|
||||
"src/nvim/version.h",
|
||||
"src/nvim/vim.h",
|
||||
"src/nvim/viml/parser/expressions.h",
|
||||
|
@ -3,9 +3,9 @@
|
||||
#include <lua.h> // IWYU pragma: keep
|
||||
#include <stdint.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/api/keysets_defs.h"
|
||||
#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/api/private/defs.h" // IWYU pragma: keep
|
||||
#include "nvim/buffer_defs.h"
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "api/buffer.h.generated.h"
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <stdint.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/api/keysets_defs.h"
|
||||
#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/api/private/defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <stdint.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/api/keysets_defs.h"
|
||||
#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/api/private/defs.h" // IWYU pragma: keep
|
||||
#include "nvim/decoration_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/macros.h"
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <stdint.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/api/keysets_defs.h"
|
||||
#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/api/private/defs.h" // IWYU pragma: keep
|
||||
#include "nvim/option_defs.h" // IWYU pragma: keep
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "nvim/api/private/defs.h"
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/memory_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
|
||||
typedef Object (*ApiDispatchWrapper)(uint64_t channel_id, Array args, Arena *arena, Error *error);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <stdint.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/api/keysets_defs.h"
|
||||
#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/api/private/defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <stdint.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/api/keysets_defs.h"
|
||||
#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/api/private/defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <stdint.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/api/keysets_defs.h"
|
||||
#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/api/private/defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "nvim/api/keysets_defs.h"
|
||||
#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/api/private/defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
@ -4,7 +4,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/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "arglist.h.generated.h"
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "bufwrite.h.generated.h"
|
||||
|
@ -1,15 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
|
||||
// flags for open_line()
|
||||
#define OPENLINE_DELSPACES 0x01 // delete spaces after cursor
|
||||
#define OPENLINE_DO_COM 0x02 // format comments
|
||||
#define OPENLINE_KEEPTRAIL 0x04 // keep trailing spaces
|
||||
#define OPENLINE_MARKFIX 0x08 // fix mark positions
|
||||
#define OPENLINE_COM_LIST 0x10 // format comments with list/2nd line indent
|
||||
#define OPENLINE_FORMAT 0x20 // formatting long comment
|
||||
/// flags for open_line()
|
||||
enum {
|
||||
OPENLINE_DELSPACES = 0x01, ///< delete spaces after cursor
|
||||
OPENLINE_DO_COM = 0x02, ///< format comments
|
||||
OPENLINE_KEEPTRAIL = 0x04, ///< keep trailing spaces
|
||||
OPENLINE_MARKFIX = 0x08, ///< fix mark positions
|
||||
OPENLINE_COM_LIST = 0x10, ///< format comments with list/2nd line indent
|
||||
OPENLINE_FORMAT = 0x20, ///< formatting long comment
|
||||
};
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "change.h.generated.h"
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/ex_getln.h"
|
||||
#include "nvim/garray_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
// Values for nextwild() and ExpandOne(). See ExpandOne() for meaning.
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "cursor.h.generated.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/garray_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "digraph.h.generated.h"
|
||||
|
@ -2,29 +2,37 @@
|
||||
|
||||
#include "nvim/autocmd_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
|
||||
// Values for in_cinkeys()
|
||||
#define KEY_OPEN_FORW 0x101
|
||||
#define KEY_OPEN_BACK 0x102
|
||||
#define KEY_COMPLETE 0x103 // end of completion
|
||||
/// Values for in_cinkeys()
|
||||
enum {
|
||||
KEY_OPEN_FORW = 0x101,
|
||||
KEY_OPEN_BACK = 0x102,
|
||||
KEY_COMPLETE = 0x103, ///< end of completion
|
||||
};
|
||||
|
||||
// Values for change_indent()
|
||||
#define INDENT_SET 1 // set indent
|
||||
#define INDENT_INC 2 // increase indent
|
||||
#define INDENT_DEC 3 // decrease indent
|
||||
/// Values for change_indent()
|
||||
enum {
|
||||
INDENT_SET = 1, ///< set indent
|
||||
INDENT_INC = 2, ///< increase indent
|
||||
INDENT_DEC = 3, ///< decrease indent
|
||||
};
|
||||
|
||||
// flags for beginline()
|
||||
#define BL_WHITE 1 // cursor on first non-white in the line
|
||||
#define BL_SOL 2 // use 'sol' option
|
||||
#define BL_FIX 4 // don't leave cursor on a NUL
|
||||
/// flags for beginline()
|
||||
enum {
|
||||
BL_WHITE = 1, ///< cursor on first non-white in the line
|
||||
BL_SOL = 2, ///< use 'sol' option
|
||||
BL_FIX = 4, ///< don't leave cursor on a NUL
|
||||
};
|
||||
|
||||
// flags for insertchar()
|
||||
#define INSCHAR_FORMAT 1 // force formatting
|
||||
#define INSCHAR_DO_COM 2 // format comments
|
||||
#define INSCHAR_CTRLV 4 // char typed just after CTRL-V
|
||||
#define INSCHAR_NO_FEX 8 // don't use 'formatexpr'
|
||||
#define INSCHAR_COM_LIST 16 // format comments with list/2nd line indent
|
||||
/// flags for insertchar()
|
||||
enum {
|
||||
INSCHAR_FORMAT = 1, ///< force formatting
|
||||
INSCHAR_DO_COM = 2, ///< format comments
|
||||
INSCHAR_CTRLV = 4, ///< char typed just after CTRL-V
|
||||
INSCHAR_NO_FEX = 8, ///< don't use 'formatexpr'
|
||||
INSCHAR_COM_LIST = 16, ///< format comments with list/2nd line indent
|
||||
};
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "edit.h.generated.h"
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "eval/buffer.h.generated.h"
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <stddef.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "eval/decode.h.generated.h"
|
||||
|
@ -3,18 +3,20 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "nvim/api/private/dispatch.h"
|
||||
#include "nvim/buffer_defs.h"
|
||||
#include "nvim/cmdexpand_defs.h"
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/eval/typval_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h"
|
||||
|
||||
/// Prototype of C function that implements Vimscript function
|
||||
typedef void (*VimLFunc)(typval_T *args, typval_T *rvar, EvalFuncData data);
|
||||
|
||||
/// Special flags for base_arg @see EvalFuncDef
|
||||
#define BASE_NONE 0 ///< Not a method (no base argument).
|
||||
#define BASE_LAST UINT8_MAX ///< Use the last argument as the method base.
|
||||
enum {
|
||||
BASE_NONE = 0, ///< Not a method (no base argument).
|
||||
BASE_LAST = UINT8_MAX, ///< Use the last argument as the method base.
|
||||
};
|
||||
|
||||
/// Structure holding Vimscript function definition
|
||||
typedef struct {
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "nvim/garray_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/hashtab.h"
|
||||
#include "nvim/option_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "eval/vars.h.generated.h"
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "nvim/eval/typval_defs.h"
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: export
|
||||
#include "nvim/os/time.h"
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
|
||||
// flags for do_ecmd()
|
||||
#define ECMD_HIDE 0x01 // don't free the current buffer
|
||||
|
@ -2,29 +2,34 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "nvim/buffer_defs.h"
|
||||
#include "nvim/cmdexpand_defs.h"
|
||||
#include "nvim/ex_cmds_defs.h"
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/getchar_defs.h"
|
||||
#include "nvim/globals.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
// flags for do_cmdline()
|
||||
#define DOCMD_VERBOSE 0x01 // included command in error message
|
||||
#define DOCMD_NOWAIT 0x02 // don't call wait_return() and friends
|
||||
#define DOCMD_REPEAT 0x04 // repeat exec. until getline() returns NULL
|
||||
#define DOCMD_KEYTYPED 0x08 // don't reset KeyTyped
|
||||
#define DOCMD_EXCRESET 0x10 // reset exception environment (for debugging
|
||||
#define DOCMD_KEEPLINE 0x20 // keep typed line for repeating with "."
|
||||
/// flags for do_cmdline()
|
||||
enum {
|
||||
DOCMD_VERBOSE = 0x01, ///< included command in error message
|
||||
DOCMD_NOWAIT = 0x02, ///< don't call wait_return() and friends
|
||||
DOCMD_REPEAT = 0x04, ///< repeat exec. until getline() returns NULL
|
||||
DOCMD_KEYTYPED = 0x08, ///< don't reset KeyTyped
|
||||
DOCMD_EXCRESET = 0x10, ///< reset exception environment (for debugging
|
||||
DOCMD_KEEPLINE = 0x20, ///< keep typed line for repeating with "."
|
||||
};
|
||||
|
||||
// defines for eval_vars()
|
||||
#define VALID_PATH 1
|
||||
#define VALID_HEAD 2
|
||||
/// defines for eval_vars()
|
||||
enum {
|
||||
VALID_PATH = 1,
|
||||
VALID_HEAD = 2,
|
||||
};
|
||||
|
||||
// Whether a command index indicates a user command.
|
||||
#define IS_USER_CMDIDX(idx) ((int)(idx) < 0)
|
||||
|
||||
// Structure used to save the current state. Used when executing Normal mode
|
||||
// commands while in any other mode.
|
||||
/// Structure used to save the current state. Used when executing Normal mode
|
||||
/// commands while in any other mode.
|
||||
typedef struct {
|
||||
int save_msg_scroll;
|
||||
int save_restart_edit;
|
||||
|
@ -5,9 +5,9 @@
|
||||
#include "klib/kvec.h"
|
||||
#include "nvim/cmdexpand_defs.h"
|
||||
#include "nvim/eval/typval_defs.h"
|
||||
#include "nvim/ex_cmds_defs.h"
|
||||
#include "nvim/option_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/option_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
struct cmdline_info;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "nvim/globals.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
// Flags for find_file_*() functions.
|
||||
#define FINDFILE_FILE 0 // only files
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/getchar_defs.h" // IWYU pragma: export
|
||||
#include "nvim/os/fileio.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
/// Argument for flush_buffers().
|
||||
typedef enum {
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "nvim/types_defs.h"
|
||||
|
||||
/// Magic number used for hashitem "hi_key" value indicating a deleted item
|
||||
///
|
||||
/// Only the address is used.
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "nvim/api/private/helpers.h"
|
||||
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/highlight_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#define MAX_HL_ID 20000 // maximum value for a highlight ID.
|
||||
|
||||
|
@ -2,16 +2,18 @@
|
||||
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
typedef int (*IndentGetter)(void);
|
||||
|
||||
// flags for set_indent()
|
||||
#define SIN_CHANGED 1 // call changed_bytes() when line changed
|
||||
#define SIN_INSERT 2 // insert indent before existing text
|
||||
#define SIN_UNDO 4 // save line for undo before changing it
|
||||
#define SIN_NOMARK 8 // don't adjust extmarks
|
||||
/// flags for set_indent()
|
||||
enum {
|
||||
SIN_CHANGED = 1, ///< call changed_bytes() when line changed
|
||||
SIN_INSERT = 2, ///< insert indent before existing text
|
||||
SIN_UNDO = 4, ///< save line for undo before changing it
|
||||
SIN_NOMARK = 8, ///< don't adjust extmarks
|
||||
};
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "indent.h.generated.h"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "indent_c.h.generated.h"
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#include "nvim/macros.h"
|
||||
#include "nvim/option_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/vim.h"
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <stddef.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "linematch.h.generated.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include <lauxlib.h>
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -1,10 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdint.h> // IWYU pragma: keep
|
||||
#include <stdio.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/api/keysets_defs.h"
|
||||
#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/api/private/defs.h" // IWYU pragma: keep
|
||||
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
|
||||
@ -12,7 +11,7 @@
|
||||
#include "nvim/mapping_defs.h" // IWYU pragma: export
|
||||
#include "nvim/option_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/regexp_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
/// Used for the first argument of do_map()
|
||||
enum {
|
||||
|
@ -3,7 +3,7 @@
|
||||
#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/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "match.h.generated.h"
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "nvim/grid_defs.h"
|
||||
#include "nvim/mbyte_defs.h" // IWYU pragma: export
|
||||
#include "nvim/os/os_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
// Return byte length of character that starts with byte "b".
|
||||
// Returns 1 for a single-byte character.
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/memline_defs.h" // IWYU pragma: export
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "memline.h.generated.h"
|
||||
|
@ -1,11 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#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/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "menu.h.generated.h"
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/vim.h"
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/option_defs.h" // IWYU pragma: export
|
||||
#include "nvim/search.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
/// The options that are local to a window or buffer have "indir" set to one of
|
||||
/// these values. Special values:
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <uv.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/os/fs_defs.h" // IWYU pragma: export
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "os/fs.h.generated.h"
|
||||
|
@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "nvim/cmdexpand_defs.h"
|
||||
#include "nvim/ex_cmds_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "os/lang.h.generated.h"
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "nvim/func_attr.h"
|
||||
#include "nvim/garray_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
// Flags for expand_wildcards()
|
||||
#define EW_DIR 0x01 // include directory names
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "nvim/buffer_defs.h"
|
||||
#include "nvim/marktree.h"
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
|
||||
/// Argument for lbr_chartabsize().
|
||||
typedef struct {
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/runtime.h"
|
||||
#include "nvim/runtime_defs.h" // IWYU pragma: keep
|
||||
|
||||
#define TIME_MSG(s) do { \
|
||||
if (time_fd != NULL) time_msg(s, NULL); \
|
||||
|
@ -3,13 +3,15 @@
|
||||
#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
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
// flags for skip_vimgrep_pat()
|
||||
#define VGR_GLOBAL 1
|
||||
#define VGR_NOJUMP 2
|
||||
#define VGR_FUZZY 4
|
||||
/// flags for skip_vimgrep_pat()
|
||||
enum {
|
||||
VGR_GLOBAL = 1,
|
||||
VGR_NOJUMP = 2,
|
||||
VGR_FUZZY = 4,
|
||||
};
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "quickfix.h.generated.h"
|
||||
|
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/regexp_defs.h" // IWYU pragma: export
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
// Second argument for vim_regcomp().
|
||||
#define RE_MAGIC 1 ///< 'magic' option
|
||||
|
@ -10,6 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
@ -32,25 +33,29 @@ typedef enum {
|
||||
MAGIC_ALL = 4, ///< "\v" very magic
|
||||
} magic_T;
|
||||
|
||||
// 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".
|
||||
#define NSUBEXP 10
|
||||
/// 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".
|
||||
enum { NSUBEXP = 10, };
|
||||
|
||||
// In the NFA engine: how many braces are allowed.
|
||||
// TODO(RE): Use dynamic memory allocation instead of static, like here
|
||||
#define NFA_MAX_BRACES 20
|
||||
/// In the NFA engine: how many braces are allowed.
|
||||
/// TODO(RE): Use dynamic memory allocation instead of static, like here
|
||||
enum { NFA_MAX_BRACES = 20, };
|
||||
|
||||
// In the NFA engine: how many states are allowed.
|
||||
#define NFA_MAX_STATES 100000
|
||||
#define NFA_TOO_EXPENSIVE (-1)
|
||||
/// In the NFA engine: how many states are allowed.
|
||||
enum {
|
||||
NFA_MAX_STATES = 100000,
|
||||
NFA_TOO_EXPENSIVE = -1,
|
||||
};
|
||||
|
||||
// Which regexp engine to use? Needed for vim_regcomp().
|
||||
// Must match with 'regexpengine'.
|
||||
#define AUTOMATIC_ENGINE 0
|
||||
#define BACKTRACKING_ENGINE 1
|
||||
#define NFA_ENGINE 2
|
||||
/// Which regexp engine to use? Needed for vim_regcomp().
|
||||
/// Must match with 'regexpengine'.
|
||||
enum {
|
||||
AUTOMATIC_ENGINE = 0,
|
||||
BACKTRACKING_ENGINE = 1,
|
||||
NFA_ENGINE = 2,
|
||||
};
|
||||
|
||||
typedef struct regengine regengine_T;
|
||||
typedef struct regprog regprog_T;
|
||||
@ -69,14 +74,14 @@ typedef struct {
|
||||
|
||||
colnr_T rmm_matchcol; ///< match start without "\zs"
|
||||
int rmm_ic;
|
||||
colnr_T rmm_maxcol; /// when not zero: maximum column
|
||||
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.
|
||||
/// 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.
|
||||
struct regprog {
|
||||
regengine_T *engine;
|
||||
unsigned regflags;
|
||||
@ -85,9 +90,9 @@ struct regprog {
|
||||
bool re_in_use; ///< prog is being executed
|
||||
};
|
||||
|
||||
// Structure used by the back track matcher.
|
||||
// These fields are only to be used in regexp.c!
|
||||
// See regexp.c for an explanation.
|
||||
/// Structure used by the back track matcher.
|
||||
/// These fields are only to be used in regexp.c!
|
||||
/// See regexp.c for an explanation.
|
||||
typedef struct {
|
||||
// These four members implement regprog_T.
|
||||
regengine_T *engine;
|
||||
@ -104,19 +109,19 @@ typedef struct {
|
||||
uint8_t program[];
|
||||
} bt_regprog_T;
|
||||
|
||||
// Structure representing a NFA state.
|
||||
// An NFA state may have no outgoing edge, when it is a NFA_MATCH state.
|
||||
/// Structure representing a NFA state.
|
||||
/// An NFA state may have no outgoing edge, when it is a NFA_MATCH state.
|
||||
typedef struct nfa_state nfa_state_T;
|
||||
struct nfa_state {
|
||||
int c;
|
||||
nfa_state_T *out;
|
||||
nfa_state_T *out1;
|
||||
int id;
|
||||
int lastlist[2]; // 0: normal, 1: recursive
|
||||
int lastlist[2]; ///< 0: normal, 1: recursive
|
||||
int val;
|
||||
};
|
||||
|
||||
// Structure used by the NFA matcher.
|
||||
/// Structure used by the NFA matcher.
|
||||
typedef struct {
|
||||
// These four members implement regprog_T.
|
||||
regengine_T *engine;
|
||||
@ -125,24 +130,24 @@ typedef struct {
|
||||
unsigned re_flags;
|
||||
bool re_in_use;
|
||||
|
||||
nfa_state_T *start; // points into state[]
|
||||
nfa_state_T *start; ///< points into state[]
|
||||
|
||||
int reganch; // pattern starts with ^
|
||||
int regstart; // char at start of pattern
|
||||
uint8_t *match_text; // plain text to match with
|
||||
int reganch; ///< pattern starts with ^
|
||||
int regstart; ///< char at start of pattern
|
||||
uint8_t *match_text; ///< plain text to match with
|
||||
|
||||
int has_zend; // pattern contains \ze
|
||||
int has_backref; // pattern contains \1 .. \9
|
||||
int has_zend; ///< pattern contains \ze
|
||||
int has_backref; ///< pattern contains \1 .. \9
|
||||
int reghasz;
|
||||
char *pattern;
|
||||
int nsubexp; // number of ()
|
||||
int nsubexp; ///< number of ()
|
||||
int nstate;
|
||||
nfa_state_T state[];
|
||||
} nfa_regprog_T;
|
||||
|
||||
// Structure to be used for single-line matching.
|
||||
// Sub-match "no" starts at "startp[no]" and ends just before "endp[no]".
|
||||
// When there is no match, the pointer is NULL.
|
||||
/// Structure to be used for single-line matching.
|
||||
/// Sub-match "no" starts at "startp[no]" and ends just before "endp[no]".
|
||||
/// When there is no match, the pointer is NULL.
|
||||
typedef struct {
|
||||
regprog_T *regprog;
|
||||
char *startp[NSUBEXP];
|
||||
@ -152,9 +157,9 @@ typedef struct {
|
||||
bool rm_ic;
|
||||
} regmatch_T;
|
||||
|
||||
// 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.
|
||||
/// 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 {
|
||||
int16_t refcnt;
|
||||
uint8_t *matches[NSUBEXP];
|
||||
@ -172,7 +177,9 @@ struct regengine {
|
||||
// uint8_t *expr;
|
||||
};
|
||||
|
||||
// Flags used by vim_regsub() and vim_regsub_both()
|
||||
#define REGSUB_COPY 1
|
||||
#define REGSUB_MAGIC 2
|
||||
#define REGSUB_BACKSLASH 4
|
||||
/// Flags used by vim_regsub() and vim_regsub_both()
|
||||
enum {
|
||||
REGSUB_COPY = 1,
|
||||
REGSUB_MAGIC = 2,
|
||||
REGSUB_BACKSLASH = 4,
|
||||
};
|
||||
|
@ -76,6 +76,15 @@ struct source_cookie {
|
||||
vimconv_T conv; ///< type of conversion
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
char *path;
|
||||
bool after;
|
||||
TriState has_lua;
|
||||
} SearchPathItem;
|
||||
|
||||
typedef kvec_t(SearchPathItem) RuntimeSearchPath;
|
||||
typedef kvec_t(char *) CharVec;
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "runtime.c.generated.h"
|
||||
#endif
|
||||
@ -432,7 +441,7 @@ int do_in_path(const char *path, const char *prefix, char *name, int flags,
|
||||
return did_one ? OK : FAIL;
|
||||
}
|
||||
|
||||
RuntimeSearchPath runtime_search_path_get_cached(int *ref)
|
||||
static RuntimeSearchPath runtime_search_path_get_cached(int *ref)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
runtime_search_path_validate();
|
||||
@ -447,7 +456,7 @@ RuntimeSearchPath runtime_search_path_get_cached(int *ref)
|
||||
return runtime_search_path;
|
||||
}
|
||||
|
||||
RuntimeSearchPath copy_runtime_search_path(const RuntimeSearchPath src)
|
||||
static RuntimeSearchPath copy_runtime_search_path(const RuntimeSearchPath src)
|
||||
{
|
||||
RuntimeSearchPath dst = KV_INITIAL_VALUE;
|
||||
for (size_t j = 0; j < kv_size(src); j++) {
|
||||
@ -458,7 +467,7 @@ RuntimeSearchPath copy_runtime_search_path(const RuntimeSearchPath src)
|
||||
return dst;
|
||||
}
|
||||
|
||||
void runtime_search_path_unref(RuntimeSearchPath path, const int *ref)
|
||||
static void runtime_search_path_unref(RuntimeSearchPath path, const int *ref)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
if (*ref) {
|
||||
@ -478,7 +487,7 @@ void runtime_search_path_unref(RuntimeSearchPath path, const int *ref)
|
||||
/// When "flags" has DIP_ERR: give an error message if there is no match.
|
||||
///
|
||||
/// return FAIL when no file could be sourced, OK otherwise.
|
||||
int do_in_cached_path(char *name, int flags, DoInRuntimepathCB callback, void *cookie)
|
||||
static int do_in_cached_path(char *name, int flags, DoInRuntimepathCB callback, void *cookie)
|
||||
{
|
||||
char *tail;
|
||||
bool did_one = false;
|
||||
@ -597,8 +606,8 @@ ArrayOf(String) runtime_get_named_thread(bool lua, Array pat, bool all)
|
||||
return rv;
|
||||
}
|
||||
|
||||
ArrayOf(String) runtime_get_named_common(bool lua, Array pat, bool all,
|
||||
RuntimeSearchPath path, char *buf, size_t buf_len)
|
||||
static ArrayOf(String) runtime_get_named_common(bool lua, Array pat, bool all,
|
||||
RuntimeSearchPath path, char *buf, size_t buf_len)
|
||||
{
|
||||
ArrayOf(String) rv = ARRAY_DICT_INIT;
|
||||
for (size_t i = 0; i < kv_size(path); i++) {
|
||||
@ -734,7 +743,7 @@ static bool path_is_after(char *buf, size_t buflen)
|
||||
&& strcmp(buf + buflen - 5, "after") == 0;
|
||||
}
|
||||
|
||||
RuntimeSearchPath runtime_search_path_build(void)
|
||||
static RuntimeSearchPath runtime_search_path_build(void)
|
||||
{
|
||||
kvec_t(String) pack_entries = KV_INITIAL_VALUE;
|
||||
Map(String, int) pack_used = MAP_INIT;
|
||||
@ -809,7 +818,7 @@ const char *did_set_runtimepackpath(optset_T *args)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void runtime_search_path_free(RuntimeSearchPath path)
|
||||
static void runtime_search_path_free(RuntimeSearchPath path)
|
||||
{
|
||||
for (size_t j = 0; j < kv_size(path); j++) {
|
||||
SearchPathItem item = kv_A(path, j);
|
||||
|
@ -1,7 +1,48 @@
|
||||
#pragma once
|
||||
|
||||
#include "nvim/option_defs.h" // IWYU pragma: export
|
||||
#include <stddef.h> // IWYU pragma: keep
|
||||
|
||||
#include "nvim/api/private/defs.h" // IWYU pragma: keep
|
||||
#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/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/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
/// Stack of execution contexts. Each entry is an estack_T.
|
||||
/// Current context is at ga_len - 1.
|
||||
extern garray_T exestack;
|
||||
/// name of error message source
|
||||
#define SOURCING_NAME (((estack_T *)exestack.ga_data)[exestack.ga_len - 1].es_name)
|
||||
/// line number in the message source or zero
|
||||
#define SOURCING_LNUM (((estack_T *)exestack.ga_data)[exestack.ga_len - 1].es_lnum)
|
||||
|
||||
/// Growarray to store info about already sourced scripts.
|
||||
extern garray_T script_items;
|
||||
#define SCRIPT_ITEM(id) (((scriptitem_T **)script_items.ga_data)[(id) - 1])
|
||||
#define SCRIPT_ID_VALID(id) ((id) > 0 && (id) <= script_items.ga_len)
|
||||
|
||||
/// last argument for do_source()
|
||||
enum {
|
||||
DOSO_NONE = 0,
|
||||
DOSO_VIMRC = 1, ///< loading vimrc file
|
||||
};
|
||||
|
||||
/// Used for flags in do_in_path()
|
||||
enum {
|
||||
DIP_ALL = 0x01, ///< all matches, not just the first one
|
||||
DIP_DIR = 0x02, ///< find directories instead of files
|
||||
DIP_ERR = 0x04, ///< give an error message when none found
|
||||
DIP_START = 0x08, ///< also use "start" directory in 'packpath'
|
||||
DIP_OPT = 0x10, ///< also use "opt" directory in 'packpath'
|
||||
DIP_NORTP = 0x20, ///< do not use 'runtimepath'
|
||||
DIP_NOAFTER = 0x40, ///< skip "after" directories
|
||||
DIP_AFTER = 0x80, ///< only use "after" directories
|
||||
DIP_DIRFILE = 0x200, ///< find both files and directories
|
||||
};
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "runtime.h.generated.h"
|
||||
|
@ -1,8 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#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
|
||||
@ -30,14 +35,6 @@ typedef struct {
|
||||
} es_info;
|
||||
} estack_T;
|
||||
|
||||
/// Stack of execution contexts. Each entry is an estack_T.
|
||||
/// Current context is at ga_len - 1.
|
||||
extern garray_T exestack;
|
||||
/// name of error message source
|
||||
#define SOURCING_NAME (((estack_T *)exestack.ga_data)[exestack.ga_len - 1].es_name)
|
||||
/// line number in the message source or zero
|
||||
#define SOURCING_LNUM (((estack_T *)exestack.ga_data)[exestack.ga_len - 1].es_lnum)
|
||||
|
||||
/// Argument for estack_sfile().
|
||||
typedef enum {
|
||||
ESTACK_NONE,
|
||||
@ -76,37 +73,4 @@ typedef struct {
|
||||
int sn_prl_execed; ///< line being timed was executed
|
||||
} scriptitem_T;
|
||||
|
||||
/// Growarray to store info about already sourced scripts.
|
||||
extern garray_T script_items;
|
||||
#define SCRIPT_ITEM(id) (((scriptitem_T **)script_items.ga_data)[(id) - 1])
|
||||
#define SCRIPT_ID_VALID(id) ((id) > 0 && (id) <= script_items.ga_len)
|
||||
|
||||
typedef bool (*DoInRuntimepathCB)(int, char **, bool, void *);
|
||||
|
||||
typedef struct {
|
||||
char *path;
|
||||
bool after;
|
||||
TriState has_lua;
|
||||
} SearchPathItem;
|
||||
|
||||
typedef kvec_t(SearchPathItem) RuntimeSearchPath;
|
||||
typedef kvec_t(char *) CharVec;
|
||||
|
||||
// last argument for do_source()
|
||||
enum {
|
||||
DOSO_NONE = 0,
|
||||
DOSO_VIMRC = 1, // loading vimrc file
|
||||
};
|
||||
|
||||
// Used for flags in do_in_path()
|
||||
enum {
|
||||
DIP_ALL = 0x01, // all matches, not just the first one
|
||||
DIP_DIR = 0x02, // find directories instead of files
|
||||
DIP_ERR = 0x04, // give an error message when none found
|
||||
DIP_START = 0x08, // also use "start" directory in 'packpath'
|
||||
DIP_OPT = 0x10, // also use "opt" directory in 'packpath'
|
||||
DIP_NORTP = 0x20, // do not use 'runtimepath'
|
||||
DIP_NOAFTER = 0x40, // skip "after" directories
|
||||
DIP_AFTER = 0x80, // only use "after" directories
|
||||
DIP_DIRFILE = 0x200, // find both files and directories
|
||||
};
|
||||
|
@ -4,7 +4,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/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "sign.h.generated.h"
|
||||
|
@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h> // IWYU pragma: keep
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "klib/kvec.h"
|
||||
#include "nvim/eval/typval_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
/// Append string to string and return pointer to the next byte
|
||||
///
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "testing.h.generated.h"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "nvim/normal.h"
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "textformat.h.generated.h"
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#include "nvim/buffer_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/pos_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/undo_defs.h" // IWYU pragma: export
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
@ -1,28 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h> // IWYU pragma: keep
|
||||
#include <stdint.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/ex_cmds_defs.h"
|
||||
#include "nvim/garray_defs.h"
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
typedef struct ucmd {
|
||||
char *uc_name; // The command name
|
||||
uint32_t uc_argt; // The argument type
|
||||
char *uc_rep; // The command's replacement string
|
||||
int64_t uc_def; // The default value for a range/count
|
||||
int uc_compl; // completion type
|
||||
cmd_addr_T uc_addr_type; // The command's address type
|
||||
sctx_T uc_script_ctx; // SCTX where the command was defined
|
||||
char *uc_compl_arg; // completion argument if any
|
||||
LuaRef uc_compl_luaref; // Reference to Lua completion function
|
||||
LuaRef uc_preview_luaref; // Reference to Lua preview function
|
||||
LuaRef uc_luaref; // Reference to Lua function
|
||||
char *uc_name; ///< The command name
|
||||
uint32_t uc_argt; ///< The argument type
|
||||
char *uc_rep; ///< The command's replacement string
|
||||
int64_t uc_def; ///< The default value for a range/count
|
||||
int uc_compl; ///< completion type
|
||||
cmd_addr_T uc_addr_type; ///< The command's address type
|
||||
sctx_T uc_script_ctx; ///< SCTX where the command was defined
|
||||
char *uc_compl_arg; ///< completion argument if any
|
||||
LuaRef uc_compl_luaref; ///< Reference to Lua completion function
|
||||
LuaRef uc_preview_luaref; ///< Reference to Lua preview function
|
||||
LuaRef uc_luaref; ///< Reference to Lua function
|
||||
} ucmd_T;
|
||||
|
||||
#define UC_BUFFER 1 // -buffer: local to current buffer
|
||||
enum { UC_BUFFER = 1, }; ///< -buffer: local to current buffer
|
||||
|
||||
extern garray_T ucmds;
|
||||
|
||||
|
@ -6,34 +6,41 @@
|
||||
#include "nvim/garray_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/macros.h"
|
||||
#include "nvim/option_defs.h" // IWYU pragma: keep
|
||||
#include "nvim/types_defs.h"
|
||||
#include "nvim/types_defs.h" // IWYU pragma: keep
|
||||
|
||||
// Values for file_name_in_line()
|
||||
#define FNAME_MESS 1 // give error message
|
||||
#define FNAME_EXP 2 // expand to path
|
||||
#define FNAME_HYP 4 // check for hypertext link
|
||||
#define FNAME_INCL 8 // apply 'includeexpr'
|
||||
#define FNAME_REL 16 // ".." and "./" are relative to the (current)
|
||||
// file instead of the current directory
|
||||
#define FNAME_UNESC 32 // remove backslashes used for escaping
|
||||
/// Values for file_name_in_line()
|
||||
enum {
|
||||
FNAME_MESS = 1, ///< give error message
|
||||
FNAME_EXP = 2, ///< expand to path
|
||||
FNAME_HYP = 4, ///< check for hypertext link
|
||||
FNAME_INCL = 8, ///< apply 'includeexpr'
|
||||
FNAME_REL = 16, ///< ".." and "./" are relative to the (current)
|
||||
///< file instead of the current directory
|
||||
FNAME_UNESC = 32, ///< remove backslashes used for escaping
|
||||
};
|
||||
|
||||
// arguments for win_split()
|
||||
#define WSP_ROOM 0x01 // require enough room
|
||||
#define WSP_VERT 0x02 // split/equalize vertically
|
||||
#define WSP_HOR 0x04 // equalize horizontally
|
||||
#define WSP_TOP 0x08 // window at top-left of shell
|
||||
#define WSP_BOT 0x10 // window at bottom-right of shell
|
||||
#define WSP_HELP 0x20 // creating the help window
|
||||
#define WSP_BELOW 0x40 // put new window below/right
|
||||
#define WSP_ABOVE 0x80 // put new window above/left
|
||||
#define WSP_NEWLOC 0x100 // don't copy location list
|
||||
/// arguments for win_split()
|
||||
enum {
|
||||
WSP_ROOM = 0x01, ///< require enough room
|
||||
WSP_VERT = 0x02, ///< split/equalize vertically
|
||||
WSP_HOR = 0x04, ///< equalize horizontally
|
||||
WSP_TOP = 0x08, ///< window at top-left of shell
|
||||
WSP_BOT = 0x10, ///< window at bottom-right of shell
|
||||
WSP_HELP = 0x20, ///< creating the help window
|
||||
WSP_BELOW = 0x40, ///< put new window below/right
|
||||
WSP_ABOVE = 0x80, ///< put new window above/left
|
||||
WSP_NEWLOC = 0x100, ///< don't copy location list
|
||||
};
|
||||
|
||||
// Minimum screen size
|
||||
#define MIN_COLUMNS 12 // minimal columns for screen
|
||||
#define MIN_LINES 2 // minimal lines for screen
|
||||
/// Minimum screen size
|
||||
enum {
|
||||
MIN_COLUMNS = 12, ///< minimal columns for screen
|
||||
MIN_LINES = 2, ///< minimal lines for screen
|
||||
};
|
||||
|
||||
// Set to true if 'cmdheight' was explicitly set to 0.
|
||||
/// Set to true if 'cmdheight' was explicitly set to 0.
|
||||
EXTERN bool p_ch_was_zero INIT( = false);
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "window.h.generated.h"
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user