diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-09-30 14:41:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-30 14:41:34 +0800 |
commit | dc6d0d2daf69e2fdadda81feb97906dbc962a239 (patch) | |
tree | 7cf93549ec3282e1f42baf89e97d7890daeb5d70 | |
parent | cf8b2c0e74fd5e723b0c15c2ce84e6900fd322d3 (diff) | |
download | rneovim-dc6d0d2daf69e2fdadda81feb97906dbc962a239.tar.gz rneovim-dc6d0d2daf69e2fdadda81feb97906dbc962a239.tar.bz2 rneovim-dc6d0d2daf69e2fdadda81feb97906dbc962a239.zip |
refactor: reorganize option header files (#25437)
- Move vimoption_T to option.h
- option_defs.h is for option-related types
- option_vars.h corresponds to Vim's option.h
- option_defs.h and option_vars.h don't include each other
106 files changed, 1187 insertions, 1110 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 8b061add0d..478415376a 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -288,6 +288,10 @@ preprocess_patch() { LC_ALL=C sed -Ee 's/( [ab]\/src\/nvim)\/keymap\.h/\1\/keycodes.h/g' \ "$file" > "$file".tmp && mv "$file".tmp "$file" + # Rename option.h to option_vars.h + LC_ALL=C sed -Ee 's/( [ab]\/src\/nvim)\/option\.h/\1\/option_vars.h/g' \ + "$file" > "$file".tmp && mv "$file".tmp "$file" + # Rename terminal.txt to nvim_terminal_emulator.txt LC_ALL=C sed -Ee 's/( [ab]\/runtime\/doc)\/terminal\.txt/\1\/nvim_terminal_emulator.txt/g' \ "$file" > "$file".tmp && mv "$file".tmp "$file" diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index f064a8e82a..9d9a5080e4 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -55,6 +55,7 @@ #include "nvim/msgpack_rpc/unpacker.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" #include "nvim/os/os_defs.h" diff --git a/src/nvim/arabic.c b/src/nvim/arabic.c index 41024cafda..bab77a4a84 100644 --- a/src/nvim/arabic.c +++ b/src/nvim/arabic.c @@ -28,7 +28,7 @@ #include "nvim/ascii.h" #include "nvim/macros.h" #include "nvim/mbyte.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/vim.h" // Unicode values for Arabic characters. diff --git a/src/nvim/arglist.c b/src/nvim/arglist.c index 10e4b09600..a4221a1562 100644 --- a/src/nvim/arglist.c +++ b/src/nvim/arglist.c @@ -31,6 +31,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/path.h" #include "nvim/pos.h" diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index 8c2df6f3b5..657760914f 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -34,7 +34,7 @@ #include "nvim/memline_defs.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" #include "nvim/os/os.h" diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index e418e415e0..5025e86771 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -79,6 +79,7 @@ #include "nvim/move.h" #include "nvim/normal.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/fs_defs.h" #include "nvim/os/input.h" diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index f0fdf0a230..ebaad45960 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -28,7 +28,7 @@ typedef struct { #include "nvim/mapping_defs.h" #include "nvim/mark_defs.h" #include "nvim/marktree.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/pos.h" #include "nvim/statusline_defs.h" #include "nvim/undo_defs.h" diff --git a/src/nvim/bufwrite.c b/src/nvim/bufwrite.c index 770c269b0e..40b95e5790 100644 --- a/src/nvim/bufwrite.c +++ b/src/nvim/bufwrite.c @@ -37,6 +37,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" diff --git a/src/nvim/change.c b/src/nvim/change.c index 084a8a1897..48dc02b65b 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -39,6 +39,7 @@ #include "nvim/message.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/time.h" #include "nvim/plines.h" #include "nvim/pos.h" diff --git a/src/nvim/charset.h b/src/nvim/charset.h index d633136073..d615012cd5 100644 --- a/src/nvim/charset.h +++ b/src/nvim/charset.h @@ -7,6 +7,7 @@ #include "nvim/buffer_defs.h" #include "nvim/eval/typval_defs.h" #include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/pos.h" #include "nvim/strings.h" diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index 19182b2d5c..d733ffe6ab 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -48,6 +48,7 @@ #include "nvim/menu.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/lang.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/cmdhist.c b/src/nvim/cmdhist.c index 72379fd86d..50bdfd892f 100644 --- a/src/nvim/cmdhist.c +++ b/src/nvim/cmdhist.c @@ -22,7 +22,7 @@ #include "nvim/macros.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/pos.h" #include "nvim/regexp.h" #include "nvim/strings.h" diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c index be8fd03d57..ca309757f9 100644 --- a/src/nvim/cursor.c +++ b/src/nvim/cursor.c @@ -21,6 +21,7 @@ #include "nvim/memory.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/plines.h" #include "nvim/pos.h" #include "nvim/state.h" diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c index 4e5886406a..fb2ca9ff8c 100644 --- a/src/nvim/cursor_shape.c +++ b/src/nvim/cursor_shape.c @@ -17,7 +17,7 @@ #include "nvim/log.h" #include "nvim/macros.h" #include "nvim/memory.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/strings.h" #include "nvim/ui.h" #include "nvim/vim.h" diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 9a47a78035..3ab1da76f4 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -47,6 +47,7 @@ #include "nvim/move.h" #include "nvim/normal.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/fs_defs.h" #include "nvim/os/os.h" diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index 49fc916f23..1bcb21508b 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -31,7 +31,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/normal.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/runtime.h" #include "nvim/strings.h" diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 2c2874fbb7..eef427a7b8 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -38,6 +38,7 @@ #include "nvim/memory.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/plines.h" #include "nvim/pos.h" #include "nvim/quickfix.h" diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index a6614ffde5..cc22accf2b 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -94,6 +94,7 @@ #include "nvim/move.h" #include "nvim/normal.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/os_defs.h" #include "nvim/plines.h" #include "nvim/popupmenu.h" diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 42cc7401e6..7f29e615ab 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -48,6 +48,7 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/plines.h" #include "nvim/popupmenu.h" diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 5d0600c6c1..0bf26b2451 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -60,6 +60,7 @@ #include "nvim/msgpack_rpc/channel_defs.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/fileio.h" #include "nvim/os/fs_defs.h" diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 61f3793f4d..710d9c73a5 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -87,6 +87,7 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/dl.h" #include "nvim/os/fileio.h" diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index a392fc8a03..1ff90dd201 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -50,6 +50,14 @@ typedef struct { bool item_compare_func_err; } sortinfo_T; +/// Structure representing one list item, used for sort array. +typedef struct { + listitem_T *item; ///< Sorted list item. + int idx; ///< Sorted list item index. +} ListSortItem; + +typedef int (*ListSorter)(const void *, const void *); + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/typval.c.generated.h" #endif diff --git a/src/nvim/eval/typval_defs.h b/src/nvim/eval/typval_defs.h index 4099877539..d5e8cb0109 100644 --- a/src/nvim/eval/typval_defs.h +++ b/src/nvim/eval/typval_defs.h @@ -273,6 +273,12 @@ typedef struct { linenr_T sc_lnum; ///< line number } sctx_T; +/// Stores an identifier of a script or channel that last set an option. +typedef struct { + sctx_T script_ctx; /// script context where the option was last set + uint64_t channel_id; /// Only used when script_id is SID_API_CLIENT. +} LastSet; + /// Maximum number of function arguments enum { MAX_FUNC_ARGS = 20, }; /// Short variable name length @@ -367,12 +373,4 @@ typedef struct list_stack_S { struct list_stack_S *prev; } list_stack_T; -/// Structure representing one list item, used for sort array. -typedef struct { - listitem_T *item; ///< Sorted list item. - int idx; ///< Sorted list item index. -} ListSortItem; - -typedef int (*ListSorter)(const void *, const void *); - #endif // NVIM_EVAL_TYPVAL_DEFS_H diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index f525bcbd45..8d85c55e15 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -37,7 +37,7 @@ #include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/path.h" #include "nvim/profile.h" diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c index 44b987b36e..f9dcfb3d9d 100644 --- a/src/nvim/eval/vars.c +++ b/src/nvim/eval/vars.c @@ -36,6 +36,7 @@ #include "nvim/message.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/os.h" #include "nvim/search.h" #include "nvim/strings.h" diff --git a/src/nvim/eval/window.c b/src/nvim/eval/window.c index 6364128cfc..f64809f2ef 100644 --- a/src/nvim/eval/window.c +++ b/src/nvim/eval/window.c @@ -25,7 +25,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/move.h" -#include "nvim/option_defs.h" #include "nvim/pos.h" #include "nvim/types.h" #include "nvim/vim.h" diff --git a/src/nvim/eval/window.h b/src/nvim/eval/window.h index 995f0a55a9..671c8fbf79 100644 --- a/src/nvim/eval/window.h +++ b/src/nvim/eval/window.h @@ -11,6 +11,7 @@ #include "nvim/globals.h" #include "nvim/mark.h" #include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/os.h" #include "nvim/pos.h" #include "nvim/vim.h" diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index e9d8947bd3..127397d9fa 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -66,6 +66,7 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/fs_defs.h" #include "nvim/os/input.h" diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 2c7aa84ff8..199a5bdd43 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -36,7 +36,7 @@ #include "nvim/message.h" #include "nvim/move.h" #include "nvim/normal.h" -#include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/os_defs.h" #include "nvim/path.h" #include "nvim/pos.h" diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 5e34f2e170..02783e032b 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -61,6 +61,7 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" #include "nvim/os/os.h" diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index ee0d4608f4..b49563f44d 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -25,7 +25,7 @@ #include "nvim/globals.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/pos.h" #include "nvim/regexp.h" #include "nvim/runtime.h" diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 911e03ea9e..6fa607d569 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -58,6 +58,8 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" #include "nvim/os/os.h" diff --git a/src/nvim/ex_getln.h b/src/nvim/ex_getln.h index b21fb0506d..aaafedcb4b 100644 --- a/src/nvim/ex_getln.h +++ b/src/nvim/ex_getln.h @@ -6,6 +6,7 @@ #include "klib/kvec.h" #include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" +#include "nvim/option_defs.h" #include "nvim/types.h" struct cmdline_info; diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c index 220cd4236c..bbe57b486d 100644 --- a/src/nvim/ex_session.c +++ b/src/nvim/ex_session.c @@ -31,6 +31,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/os.h" #include "nvim/path.h" #include "nvim/pos.h" diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index c30f713b0f..7a46341797 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -64,6 +64,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 5cda5e48ec..4e8b7be4aa 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -47,6 +47,7 @@ #include "nvim/message.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/fs_defs.h" #include "nvim/os/input.h" diff --git a/src/nvim/fold.c b/src/nvim/fold.c index 298d6776bd..6a9dbe9edc 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -41,7 +41,7 @@ #include "nvim/message.h" #include "nvim/move.h" #include "nvim/ops.h" -#include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/plines.h" #include "nvim/pos.h" diff --git a/src/nvim/generators/gen_options.lua b/src/nvim/generators/gen_options.lua index 6605f936fe..0932a1357f 100644 --- a/src/nvim/generators/gen_options.lua +++ b/src/nvim/generators/gen_options.lua @@ -189,7 +189,6 @@ local function dump_option(i, o) end w([[ -#include "nvim/ex_cmds.h" #include "nvim/ex_getln.h" #include "nvim/insexpand.h" #include "nvim/mapping.h" @@ -198,8 +197,6 @@ w([[ #include "nvim/optionstr.h" #include "nvim/quickfix.h" #include "nvim/runtime.h" -#include "nvim/spell.h" -#include "nvim/spellfile.h" #include "nvim/tag.h" #include "nvim/window.h" diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index dc943922db..b696f8ab37 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -48,7 +48,7 @@ #include "nvim/move.h" #include "nvim/normal.h" #include "nvim/ops.h" -#include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/fileio.h" #include "nvim/os/input.h" #include "nvim/os/os.h" diff --git a/src/nvim/grid.c b/src/nvim/grid.c index 5588ef24a9..712688368b 100644 --- a/src/nvim/grid.c +++ b/src/nvim/grid.c @@ -29,7 +29,7 @@ #include "nvim/map.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/types.h" #include "nvim/ui.h" #include "nvim/vim.h" diff --git a/src/nvim/help.c b/src/nvim/help.c index 752f942ec7..d8b6afec27 100644 --- a/src/nvim/help.c +++ b/src/nvim/help.c @@ -30,6 +30,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" #include "nvim/os/os.h" diff --git a/src/nvim/highlight.h b/src/nvim/highlight.h index 5a4a90035c..fc311b4269 100644 --- a/src/nvim/highlight.h +++ b/src/nvim/highlight.h @@ -8,6 +8,7 @@ #include "nvim/buffer_defs.h" #include "nvim/highlight_defs.h" #include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/ui.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c index f53105aefa..080dc79e0e 100644 --- a/src/nvim/highlight_group.c +++ b/src/nvim/highlight_group.c @@ -37,6 +37,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/time.h" #include "nvim/runtime.h" #include "nvim/strings.h" diff --git a/src/nvim/indent.c b/src/nvim/indent.c index e01acb48b6..b7bc23cda5 100644 --- a/src/nvim/indent.c +++ b/src/nvim/indent.c @@ -32,6 +32,7 @@ #include "nvim/message.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" #include "nvim/plines.h" diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index 1671bf009a..7f67a24ef1 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -20,6 +20,7 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/plines.h" #include "nvim/pos.h" #include "nvim/search.h" diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 347b18f908..4a6c819015 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -46,6 +46,8 @@ #include "nvim/message.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/time.h" diff --git a/src/nvim/insexpand.h b/src/nvim/insexpand.h index 83ba14e0d2..e09004f032 100644 --- a/src/nvim/insexpand.h +++ b/src/nvim/insexpand.h @@ -4,6 +4,7 @@ #include <stdbool.h> #include "nvim/macros.h" +#include "nvim/option_defs.h" #include "nvim/vim.h" #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/keycodes.h b/src/nvim/keycodes.h index 7c143fc99e..9806808438 100644 --- a/src/nvim/keycodes.h +++ b/src/nvim/keycodes.h @@ -5,6 +5,7 @@ #include "nvim/ascii.h" #include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/strings.h" // Keycode definitions for special keys. diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 0c9bbebe26..18da7af416 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -49,7 +49,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/msgpack_rpc/channel.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/fileio.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/main.c b/src/nvim/main.c index fe80de98f6..2d7b2f231e 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -60,7 +60,7 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/fileio.h" #include "nvim/os/input.h" diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c index cbb51961d4..1fb91d85b4 100644 --- a/src/nvim/mapping.c +++ b/src/nvim/mapping.c @@ -39,6 +39,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/pos.h" #include "nvim/regexp.h" #include "nvim/regexp_defs.h" diff --git a/src/nvim/mark.c b/src/nvim/mark.c index 43f8feeae9..913c9b2a29 100644 --- a/src/nvim/mark.c +++ b/src/nvim/mark.c @@ -31,7 +31,7 @@ #include "nvim/message.h" #include "nvim/move.h" #include "nvim/normal.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/match.c b/src/nvim/match.c index 093de21c40..d54e2ce58a 100644 --- a/src/nvim/match.c +++ b/src/nvim/match.c @@ -29,7 +29,7 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/pos.h" #include "nvim/profile.h" #include "nvim/regexp.h" diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index e65652e81f..7b7c822b3b 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -60,7 +60,7 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/os.h" #include "nvim/os/os_defs.h" diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 6128ceee74..7bfa6db4ef 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -73,6 +73,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" diff --git a/src/nvim/memory.c b/src/nvim/memory.c index 9ae27e027d..997f465f02 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -29,6 +29,7 @@ #include "nvim/memfile.h" #include "nvim/memory.h" #include "nvim/message.h" +#include "nvim/option_vars.h" #include "nvim/sign.h" #include "nvim/ui.h" #include "nvim/usercmd.h" diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 84d8d39aa8..2204a0a291 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -29,7 +29,7 @@ #include "nvim/menu.h" #include "nvim/menu_defs.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/popupmenu.h" #include "nvim/pos.h" #include "nvim/state.h" diff --git a/src/nvim/message.c b/src/nvim/message.c index aef8f34947..68ea49d53b 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -43,6 +43,7 @@ #include "nvim/mouse.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/time.h" diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index 20605c52c5..0433031393 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -33,6 +33,7 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/plines.h" #include "nvim/popupmenu.h" #include "nvim/pos.h" diff --git a/src/nvim/move.c b/src/nvim/move.c index c942b70c60..8efb038a55 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -38,6 +38,7 @@ #include "nvim/mouse.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/plines.h" #include "nvim/popupmenu.h" #include "nvim/pos.h" diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 872aec89b9..715b98377a 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -56,6 +56,7 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/os/time.h" #include "nvim/plines.h" diff --git a/src/nvim/ops.c b/src/nvim/ops.c index d42ce03f9a..5d3e285e3b 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -49,6 +49,8 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/os/time.h" #include "nvim/plines.h" diff --git a/src/nvim/ops.h b/src/nvim/ops.h index e378d2f7b5..ae8b8b53e8 100644 --- a/src/nvim/ops.h +++ b/src/nvim/ops.h @@ -11,6 +11,7 @@ #include "nvim/extmark.h" #include "nvim/macros.h" #include "nvim/normal.h" +#include "nvim/option_defs.h" #include "nvim/os/time.h" #include "nvim/pos.h" #include "nvim/types.h" diff --git a/src/nvim/option.c b/src/nvim/option.c index 4c54487b95..7e7e387521 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -76,6 +76,7 @@ #include "nvim/ops.h" #include "nvim/option.h" #include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" #include "nvim/os/lang.h" diff --git a/src/nvim/option.h b/src/nvim/option.h index 4b8329ad1c..9e3bf25bc3 100644 --- a/src/nvim/option.h +++ b/src/nvim/option.h @@ -1,15 +1,95 @@ #ifndef NVIM_OPTION_H #define NVIM_OPTION_H +#include <stdint.h> + #include "nvim/api/private/helpers.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" +#include "nvim/option_defs.h" + +/// The options that are local to a window or buffer have "indir" set to one of +/// these values. Special values: +/// PV_NONE: global option. +/// PV_WIN is added: window-local option +/// PV_BUF is added: buffer-local option +/// PV_BOTH is added: global option which also has a local value. +enum { + PV_BOTH = 0x1000, + PV_WIN = 0x2000, + PV_BUF = 0x4000, + PV_MASK = 0x0fff, +}; +#define OPT_WIN(x) (idopt_T)(PV_WIN + (int)(x)) +#define OPT_BUF(x) (idopt_T)(PV_BUF + (int)(x)) +#define OPT_BOTH(x) (idopt_T)(PV_BOTH + (int)(x)) + +/// WV_ and BV_ values get typecasted to this for the "indir" field +typedef enum { + PV_NONE = 0, + PV_MAXVAL = 0xffff, ///< to avoid warnings for value out of range +} idopt_T; + +// Options local to a window have a value local to a buffer and global to all +// buffers. Indicate this by setting "var" to VAR_WIN. +#define VAR_WIN ((char *)-1) + +typedef struct vimoption { + char *fullname; ///< full option name + char *shortname; ///< permissible abbreviation + uint32_t flags; ///< see above + void *var; ///< global option: pointer to variable; + ///< window-local option: VAR_WIN; + ///< buffer-local option: global value + idopt_T indir; ///< global option: PV_NONE; + ///< local option: indirect option index + ///< callback function to invoke after an option is modified to validate and + ///< apply the new value. + opt_did_set_cb_T opt_did_set_cb; + void *def_val; ///< default values for variable (neovim!!) + LastSet last_set; ///< script in which the option was last set +} vimoption_T; + +/// flags for buf_copy_options() +enum { + BCO_ENTER = 1, ///< going to enter the buffer + BCO_ALWAYS = 2, ///< always copy the options + BCO_NOHELP = 4, ///< don't touch the help related options +}; + +/// Flags for option-setting functions +/// +/// When OPT_GLOBAL and OPT_LOCAL are both missing, set both local and global +/// values, get local value. +typedef enum { + OPT_FREE = 0x01, ///< Free old value if it was allocated. + OPT_GLOBAL = 0x02, ///< Use global value. + OPT_LOCAL = 0x04, ///< Use local value. + OPT_MODELINE = 0x08, ///< Option in modeline. + OPT_WINONLY = 0x10, ///< Only set window-local options. + OPT_NOWIN = 0x20, ///< Don’t set window-local options. + OPT_ONECOLUMN = 0x40, ///< list options one per line + OPT_NO_REDRAW = 0x80, ///< ignore redraw flags on option + OPT_SKIPRTP = 0x100, ///< "skiprtp" in 'sessionoptions' +} OptionFlags; -// flags for buf_copy_options() -#define BCO_ENTER 1 // going to enter the buffer -#define BCO_ALWAYS 2 // always copy the options -#define BCO_NOHELP 4 // don't touch the help related options +/// Return value from get_option_value_strict +enum { + SOPT_BOOL = 0x01, ///< Boolean option + SOPT_NUM = 0x02, ///< Number option + SOPT_STRING = 0x04, ///< String option + SOPT_GLOBAL = 0x08, ///< Option has global value + SOPT_WIN = 0x10, ///< Option has window-local value + SOPT_BUF = 0x20, ///< Option has buffer-local value + SOPT_UNSET = 0x40, ///< Option does not have local value set +}; -#define MAX_NUMBERWIDTH 20 // used for 'numberwidth' and 'statuscolumn' +/// Option types for various functions in option.c +enum { + SREQ_GLOBAL = 0, ///< Request global option value + SREQ_WIN = 1, ///< Request window-local option value + SREQ_BUF = 2, ///< Request buffer-local option value +}; // OptVal helper macros. #define NIL_OPTVAL ((OptVal) { .type = kOptValTypeNil }) diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index 1640bcb36b..f078f6073c 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -3,1019 +3,69 @@ #include "nvim/api/private/defs.h" #include "nvim/eval/typval_defs.h" -#include "nvim/macros.h" #include "nvim/types.h" -// option_defs.h: definition of global variables for settable options - -// Option Flags -#define P_BOOL 0x01U ///< the option is boolean -#define P_NUM 0x02U ///< the option is numeric -#define P_STRING 0x04U ///< the option is a string -#define P_ALLOCED 0x08U ///< the string option is in allocated memory, - ///< must use free_string_option() when - ///< assigning new value. Not set if default is - ///< the same. -#define P_EXPAND 0x10U ///< environment expansion. NOTE: P_EXPAND can - ///< never be used for local or hidden options -#define P_NODEFAULT 0x40U ///< don't set to default value -#define P_DEF_ALLOCED 0x80U ///< default value is in allocated memory, must - ///< use free() when assigning new value -#define P_WAS_SET 0x100U ///< option has been set/reset -#define P_NO_MKRC 0x200U ///< don't include in :mkvimrc output - -// when option changed, what to display: -#define P_UI_OPTION 0x400U ///< send option to remote UI -#define P_RTABL 0x800U ///< redraw tabline -#define P_RSTAT 0x1000U ///< redraw status lines -#define P_RWIN 0x2000U ///< redraw current window and recompute text -#define P_RBUF 0x4000U ///< redraw current buffer and recompute text -#define P_RALL 0x6000U ///< redraw all windows -#define P_RCLR 0x7000U ///< clear and redraw all - -#define P_COMMA 0x8000U ///< comma separated list -#define P_ONECOMMA 0x18000U ///< P_COMMA and cannot have two consecutive - ///< commas -#define P_NODUP 0x20000U ///< don't allow duplicate strings -#define P_FLAGLIST 0x40000U ///< list of single-char flags - -#define P_SECURE 0x80000U ///< cannot change in modeline or secure mode -#define P_GETTEXT 0x100000U ///< expand default value with _() -#define P_NOGLOB 0x200000U ///< do not use local value for global vimrc -#define P_NFNAME 0x400000U ///< only normal file name chars allowed -#define P_INSECURE 0x800000U ///< option was set from a modeline -#define P_PRI_MKRC 0x1000000U ///< priority for :mkvimrc (setting option - ///< has side effects) -#define P_NO_ML 0x2000000U ///< not allowed in modeline -#define P_CURSWANT 0x4000000U ///< update curswant required; not needed - ///< when there is a redraw flag -#define P_NDNAME 0x8000000U ///< only normal dir name chars allowed -#define P_RWINONLY 0x10000000U ///< only redraw current window -#define P_MLE 0x20000000U ///< under control of 'modelineexpr' -#define P_FUNC 0x40000000U ///< accept a function reference or a lambda - -#define P_NO_DEF_EXP 0x80000000U ///< Do not expand default value. - -/// Flags for option-setting functions -/// -/// When OPT_GLOBAL and OPT_LOCAL are both missing, set both local and global -/// values, get local value. +/// Option value type typedef enum { - OPT_FREE = 0x01, ///< Free old value if it was allocated. - OPT_GLOBAL = 0x02, ///< Use global value. - OPT_LOCAL = 0x04, ///< Use local value. - OPT_MODELINE = 0x08, ///< Option in modeline. - OPT_WINONLY = 0x10, ///< Only set window-local options. - OPT_NOWIN = 0x20, ///< Don’t set window-local options. - OPT_ONECOLUMN = 0x40, ///< list options one per line - OPT_NO_REDRAW = 0x80, ///< ignore redraw flags on option - OPT_SKIPRTP = 0x100, ///< "skiprtp" in 'sessionoptions' -} OptionFlags; - -// Return value from get_option_value_strict -#define SOPT_BOOL 0x01 // Boolean option -#define SOPT_NUM 0x02 // Number option -#define SOPT_STRING 0x04 // String option -#define SOPT_GLOBAL 0x08 // Option has global value -#define SOPT_WIN 0x10 // Option has window-local value -#define SOPT_BUF 0x20 // Option has buffer-local value -#define SOPT_UNSET 0x40 // Option does not have local value set - -// Option types for various functions in option.c -#define SREQ_GLOBAL 0 // Request global option value -#define SREQ_WIN 1 // Request window-local option value -#define SREQ_BUF 2 // Request buffer-local option value - -#define HIGHLIGHT_INIT \ - "8:SpecialKey,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText,d:Directory,e:ErrorMsg," \ - "i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow," \ - "N:CursorLineNr,G:CursorLineSign,O:CursorLineFold" \ - "r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg," \ - "W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn," \ - "-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel," \ - "[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb," \ - "*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn," \ - "q:QuickFixLine,0:Whitespace,I:NormalNC" - -// Default values for 'errorformat'. -// The "%f|%l| %m" one is used for when the contents of the quickfix window is -// written to a file. -#ifdef MSWIN -# define DFLT_EFM \ - "%f(%l) \\=: %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f(%l) \\=: %m,%*[^ ] %f %l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,%f|%l| %m" -#else -# define DFLT_EFM \ - "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-Gg%\\?make[%*\\d]: *** [%f:%l:%m,%-Gg%\\?make: *** [%f:%l:%m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c\\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory %*[`']%f',%X%*\\a[%*\\d]: Leaving directory %*[`']%f',%D%*\\a: Entering directory %*[`']%f',%X%*\\a: Leaving directory %*[`']%f',%DMaking %*\\a in %f,%f|%l| %m" -#endif - -#define DFLT_GREPFORMAT "%f:%l:%m,%f:%l%m,%f %l%m" - -// default values for b_p_ff 'fileformat' and p_ffs 'fileformats' -#define FF_DOS "dos" -#define FF_MAC "mac" -#define FF_UNIX "unix" - -#ifdef USE_CRNL -# define DFLT_FF "dos" -# define DFLT_FFS_VIM "dos,unix" -# define DFLT_FFS_VI "dos,unix" // also autodetect in compatible mode -#else -# define DFLT_FF "unix" -# define DFLT_FFS_VIM "unix,dos" -# define DFLT_FFS_VI "" -#endif - -// Possible values for 'encoding' -#define ENC_UCSBOM "ucs-bom" // check for BOM at start of file - -// default value for 'encoding' -#define ENC_DFLT "utf-8" - -// end-of-line style -#define EOL_UNKNOWN (-1) // not defined yet -#define EOL_UNIX 0 // NL -#define EOL_DOS 1 // CR NL -#define EOL_MAC 2 // CR - -// Formatting options for p_fo 'formatoptions' -#define FO_WRAP 't' -#define FO_WRAP_COMS 'c' -#define FO_RET_COMS 'r' -#define FO_OPEN_COMS 'o' -#define FO_NO_OPEN_COMS '/' -#define FO_Q_COMS 'q' -#define FO_Q_NUMBER 'n' -#define FO_Q_SECOND '2' -#define FO_INS_VI 'v' -#define FO_INS_LONG 'l' -#define FO_INS_BLANK 'b' -#define FO_MBYTE_BREAK 'm' // break before/after multi-byte char -#define FO_MBYTE_JOIN 'M' // no space before/after multi-byte char -#define FO_MBYTE_JOIN2 'B' // no space between multi-byte chars -#define FO_ONE_LETTER '1' -#define FO_WHITE_PAR 'w' // trailing white space continues paragr. -#define FO_AUTO 'a' // automatic formatting -#define FO_RIGOROUS_TW ']' // respect textwidth rigorously -#define FO_REMOVE_COMS 'j' // remove comment leaders when joining lines -#define FO_PERIOD_ABBR 'p' // don't break a single space after a period - -#define DFLT_FO_VI "vt" -#define DFLT_FO_VIM "tcqj" -#define FO_ALL "tcro/q2vlb1mMBn,aw]jp" // for do_set() - -// characters for the p_cpo option: -#define CPO_ALTREAD 'a' // ":read" sets alternate file name -#define CPO_ALTWRITE 'A' // ":write" sets alternate file name -#define CPO_BAR 'b' // "\|" ends a mapping -#define CPO_BSLASH 'B' // backslash in mapping is not special -#define CPO_SEARCH 'c' -#define CPO_CONCAT 'C' // Don't concatenate sourced lines -#define CPO_DOTTAG 'd' // "./tags" in 'tags' is in current dir -#define CPO_DIGRAPH 'D' // No digraph after "r", "f", etc. -#define CPO_EXECBUF 'e' -#define CPO_EMPTYREGION 'E' // operating on empty region is an error -#define CPO_FNAMER 'f' // set file name for ":r file" -#define CPO_FNAMEW 'F' // set file name for ":w file" -#define CPO_INTMOD 'i' // interrupt a read makes buffer modified -#define CPO_INDENT 'I' // remove auto-indent more often -#define CPO_ENDOFSENT 'J' // need two spaces to detect end of sentence -#define CPO_KOFFSET 'K' // don't wait for key code in mappings -#define CPO_LITERAL 'l' // take char after backslash in [] literal -#define CPO_LISTWM 'L' // 'list' changes wrapmargin -#define CPO_SHOWMATCH 'm' -#define CPO_MATCHBSL 'M' // "%" ignores use of backslashes -#define CPO_NUMCOL 'n' // 'number' column also used for text -#define CPO_LINEOFF 'o' -#define CPO_OVERNEW 'O' // silently overwrite new file -#define CPO_LISP 'p' // 'lisp' indenting -#define CPO_FNAMEAPP 'P' // set file name for ":w >>file" -#define CPO_JOINCOL 'q' // with "3J" use column after first join -#define CPO_REDO 'r' -#define CPO_REMMARK 'R' // remove marks when filtering -#define CPO_BUFOPT 's' -#define CPO_BUFOPTGLOB 'S' -#define CPO_TAGPAT 't' // tag pattern is used for "n" -#define CPO_UNDO 'u' // "u" undoes itself -#define CPO_BACKSPACE 'v' // "v" keep deleted text -#define CPO_FWRITE 'W' // "w!" doesn't overwrite readonly files -#define CPO_ESC 'x' -#define CPO_REPLCNT 'X' // "R" with a count only deletes chars once -#define CPO_YANK 'y' -#define CPO_KEEPRO 'Z' // don't reset 'readonly' on ":w!" -#define CPO_DOLLAR '$' -#define CPO_FILTER '!' -#define CPO_MATCH '%' -#define CPO_PLUS '+' // ":write file" resets 'modified' -#define CPO_REGAPPEND '>' // insert NL when appending to a register -#define CPO_SCOLON ';' // using "," and ";" will skip over char if - // cursor would not move -#define CPO_CHANGEW '_' // "cw" special-case -// default values for Vim and Vi -#define CPO_VIM "aABceFs_" -#define CPO_VI "aAbBcCdDeEfFiIJKlLmMnoOpPqrRsStuvWxXyZ$!%+>;_" - -// characters for p_ww option: -#define WW_ALL "bshl<>[],~" - -// characters for p_mouse option: -#define MOUSE_NORMAL 'n' // use mouse in Normal mode -#define MOUSE_VISUAL 'v' // use mouse in Visual/Select mode -#define MOUSE_INSERT 'i' // use mouse in Insert mode -#define MOUSE_COMMAND 'c' // use mouse in Command-line mode -#define MOUSE_HELP 'h' // use mouse in help buffers -#define MOUSE_RETURN 'r' // use mouse for hit-return message -#define MOUSE_A "nvich" // used for 'a' flag -#define MOUSE_ALL "anvichr" // all possible characters -#define MOUSE_NONE ' ' // don't use Visual selection -#define MOUSE_NONEF 'x' // forced modeless selection - -// default vertical and horizontal mouse scroll values. -// Note: This should be in sync with the default mousescroll option. -#define MOUSESCROLL_VERT_DFLT 3 -#define MOUSESCROLL_HOR_DFLT 6 - -#define COCU_ALL "nvic" // flags for 'concealcursor' - -/// characters for p_shm option: -enum { - SHM_RO = 'r', ///< Readonly. - SHM_MOD = 'm', ///< Modified. - SHM_LINES = 'l', ///< "L" instead of "lines". - SHM_WRI = 'w', ///< "[w]" instead of "written". - SHM_ABBREVIATIONS = 'a', ///< Use abbreviations from #SHM_ALL_ABBREVIATIONS. - SHM_WRITE = 'W', ///< Don't use "written" at all. - SHM_TRUNC = 't', ///< Truncate file messages. - SHM_TRUNCALL = 'T', ///< Truncate all messages. - SHM_OVER = 'o', ///< Overwrite file messages. - SHM_OVERALL = 'O', ///< Overwrite more messages. - SHM_SEARCH = 's', ///< No search hit bottom messages. - SHM_ATTENTION = 'A', ///< No ATTENTION messages. - SHM_INTRO = 'I', ///< Intro messages. - SHM_COMPLETIONMENU = 'c', ///< Completion menu messages. - SHM_COMPLETIONSCAN = 'C', ///< Completion scanning messages. - SHM_RECORDING = 'q', ///< Short recording message. - SHM_FILEINFO = 'F', ///< No file info messages. - SHM_SEARCHCOUNT = 'S', ///< No search stats: '[1/10]' -}; -/// Represented by 'a' flag. -#define SHM_ALL_ABBREVIATIONS ((char[]) { \ - SHM_RO, SHM_MOD, SHM_LINES, SHM_WRI, \ - 0 }) - -// characters for p_go: -#define GO_ASEL 'a' // autoselect -#define GO_ASELML 'A' // autoselect modeless selection -#define GO_BOT 'b' // use bottom scrollbar -#define GO_CONDIALOG 'c' // use console dialog -#define GO_DARKTHEME 'd' // use dark theme variant -#define GO_TABLINE 'e' // may show tabline -#define GO_FORG 'f' // start GUI in foreground -#define GO_GREY 'g' // use grey menu items -#define GO_HORSCROLL 'h' // flexible horizontal scrolling -#define GO_ICON 'i' // use Vim icon -#define GO_LEFT 'l' // use left scrollbar -#define GO_VLEFT 'L' // left scrollbar with vert split -#define GO_MENUS 'm' // use menu bar -#define GO_NOSYSMENU 'M' // don't source system menu -#define GO_POINTER 'p' // pointer enter/leave callbacks -#define GO_ASELPLUS 'P' // autoselectPlus -#define GO_RIGHT 'r' // use right scrollbar -#define GO_VRIGHT 'R' // right scrollbar with vert split -#define GO_TOOLBAR 'T' // add toolbar -#define GO_FOOTER 'F' // add footer -#define GO_VERTICAL 'v' // arrange dialog buttons vertically -#define GO_KEEPWINSIZE 'k' // keep GUI window size -#define GO_ALL "!aAbcdefFghilLmMpPrRtTvk" // all possible flags for 'go' - -// flags for 'comments' option -#define COM_NEST 'n' // comments strings nest -#define COM_BLANK 'b' // needs blank after string -#define COM_START 's' // start of comment -#define COM_MIDDLE 'm' // middle of comment -#define COM_END 'e' // end of comment -#define COM_AUTO_END 'x' // last char of end closes comment -#define COM_FIRST 'f' // first line comment only -#define COM_LEFT 'l' // left adjusted -#define COM_RIGHT 'r' // right adjusted -#define COM_NOBACK 'O' // don't use for "O" command -#define COM_ALL "nbsmexflrO" // all flags for 'comments' option -#define COM_MAX_LEN 50 // maximum length of a part - -/// 'statusline' option flags -enum { - STL_FILEPATH = 'f', ///< Path of file in buffer. - STL_FULLPATH = 'F', ///< Full path of file in buffer. - STL_FILENAME = 't', ///< Last part (tail) of file path. - STL_COLUMN = 'c', ///< Column og cursor. - STL_VIRTCOL = 'v', ///< Virtual column. - STL_VIRTCOL_ALT = 'V', ///< - with 'if different' display. - STL_LINE = 'l', ///< Line number of cursor. - STL_NUMLINES = 'L', ///< Number of lines in buffer. - STL_BUFNO = 'n', ///< Current buffer number. - STL_KEYMAP = 'k', ///< 'keymap' when active. - STL_OFFSET = 'o', ///< Offset of character under cursor. - STL_OFFSET_X = 'O', ///< - in hexadecimal. - STL_BYTEVAL = 'b', ///< Byte value of character. - STL_BYTEVAL_X = 'B', ///< - in hexadecimal. - STL_ROFLAG = 'r', ///< Readonly flag. - STL_ROFLAG_ALT = 'R', ///< - other display. - STL_HELPFLAG = 'h', ///< Window is showing a help file. - STL_HELPFLAG_ALT = 'H', ///< - other display. - STL_FILETYPE = 'y', ///< 'filetype'. - STL_FILETYPE_ALT = 'Y', ///< - other display. - STL_PREVIEWFLAG = 'w', ///< Window is showing the preview buf. - STL_PREVIEWFLAG_ALT = 'W', ///< - other display. - STL_MODIFIED = 'm', ///< Modified flag. - STL_MODIFIED_ALT = 'M', ///< - other display. - STL_QUICKFIX = 'q', ///< Quickfix window description. - STL_PERCENTAGE = 'p', ///< Percentage through file. - STL_ALTPERCENT = 'P', ///< Percentage as TOP BOT ALL or NN%. - STL_ARGLISTSTAT = 'a', ///< Argument list status as (x of y). - STL_PAGENUM = 'N', ///< Page number (when printing). - STL_SHOWCMD = 'S', ///< 'showcmd' buffer - STL_FOLDCOL = 'C', ///< Fold column for 'statuscolumn' - STL_SIGNCOL = 's', ///< Sign column for 'statuscolumn' - STL_VIM_EXPR = '{', ///< Start of expression to substitute. - STL_SEPARATE = '=', ///< Separation between alignment sections. - STL_TRUNCMARK = '<', ///< Truncation mark if line is too long. - STL_USER_HL = '*', ///< Highlight from (User)1..9 or 0. - STL_HIGHLIGHT = '#', ///< Highlight name. - STL_TABPAGENR = 'T', ///< Tab page label nr. - STL_TABCLOSENR = 'X', ///< Tab page close nr. - STL_CLICK_FUNC = '@', ///< Click region start. -}; -/// C string containing all 'statusline' option flags -#define STL_ALL ((char[]) { \ - STL_FILEPATH, STL_FULLPATH, STL_FILENAME, STL_COLUMN, STL_VIRTCOL, \ - STL_VIRTCOL_ALT, STL_LINE, STL_NUMLINES, STL_BUFNO, STL_KEYMAP, STL_OFFSET, \ - STL_OFFSET_X, STL_BYTEVAL, STL_BYTEVAL_X, STL_ROFLAG, STL_ROFLAG_ALT, \ - STL_HELPFLAG, STL_HELPFLAG_ALT, STL_FILETYPE, STL_FILETYPE_ALT, \ - STL_PREVIEWFLAG, STL_PREVIEWFLAG_ALT, STL_MODIFIED, STL_MODIFIED_ALT, \ - STL_QUICKFIX, STL_PERCENTAGE, STL_ALTPERCENT, STL_ARGLISTSTAT, STL_PAGENUM, \ - STL_SHOWCMD, STL_FOLDCOL, STL_SIGNCOL, STL_VIM_EXPR, STL_SEPARATE, \ - STL_TRUNCMARK, STL_USER_HL, STL_HIGHLIGHT, STL_TABPAGENR, STL_TABCLOSENR, \ - STL_CLICK_FUNC, STL_TABPAGENR, STL_TABCLOSENR, STL_CLICK_FUNC, \ - 0, }) - -// flags used for parsed 'wildmode' -#define WIM_FULL 0x01 -#define WIM_LONGEST 0x02 -#define WIM_LIST 0x04 -#define WIM_BUFLASTUSED 0x08 - -// arguments for can_bs() -// each defined char should be unique over all values -// except for BS_START, that intentionally also matches BS_NOSTOP -// because BS_NOSTOP behaves exactly the same except it -// does not stop at the start of the insert point -#define BS_INDENT 'i' // "Indent" -#define BS_EOL 'l' // "eoL" -#define BS_START 's' // "Start" -#define BS_NOSTOP 'p' // "nostoP - -// flags for the 'culopt' option -#define CULOPT_LINE 0x01 // Highlight complete line -#define CULOPT_SCRLINE 0x02 // Highlight screen line -#define CULOPT_NBR 0x04 // Highlight Number column - -#define LISPWORD_VALUE \ - "defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defclass,defmethod,print-unreadable-object" - -// The following are actual variables for the options - -EXTERN char *p_ambw; ///< 'ambiwidth' -EXTERN int p_acd; ///< 'autochdir' -EXTERN int p_ai; ///< 'autoindent' -EXTERN int p_bin; ///< 'binary' -EXTERN int p_bomb; ///< 'bomb' -EXTERN int p_bl; ///< 'buflisted' -EXTERN int p_cin; ///< 'cindent' -EXTERN OptInt p_channel; ///< 'channel' -EXTERN char *p_cink; ///< 'cinkeys' -EXTERN char *p_cinsd; ///< 'cinscopedecls' -EXTERN char *p_cinw; ///< 'cinwords' -EXTERN char *p_cfu; ///< 'completefunc' -EXTERN char *p_ofu; ///< 'omnifunc' -EXTERN char *p_tsrfu; ///< 'thesaurusfunc' -EXTERN int p_ci; ///< 'copyindent' -EXTERN int p_ar; // 'autoread' -EXTERN int p_aw; // 'autowrite' -EXTERN int p_awa; // 'autowriteall' -EXTERN char *p_bs; // 'backspace' -EXTERN char *p_bg; // 'background' -EXTERN int p_bk; // 'backup' -EXTERN char *p_bkc; // 'backupcopy' -EXTERN unsigned bkc_flags; ///< flags from 'backupcopy' -#define BKC_YES 0x001 -#define BKC_AUTO 0x002 -#define BKC_NO 0x004 -#define BKC_BREAKSYMLINK 0x008 -#define BKC_BREAKHARDLINK 0x010 -EXTERN char *p_bdir; // 'backupdir' -EXTERN char *p_bex; // 'backupext' -EXTERN char *p_bo; // 'belloff' -EXTERN char breakat_flags[256]; // which characters are in 'breakat' -EXTERN unsigned bo_flags; - -// values for the 'belloff' option -#define BO_ALL 0x0001 -#define BO_BS 0x0002 -#define BO_CRSR 0x0004 -#define BO_COMPL 0x0008 -#define BO_COPY 0x0010 -#define BO_CTRLG 0x0020 -#define BO_ERROR 0x0040 -#define BO_ESC 0x0080 -#define BO_EX 0x0100 -#define BO_HANGUL 0x0200 -#define BO_IM 0x0400 -#define BO_LANG 0x0800 -#define BO_MESS 0x1000 -#define BO_MATCH 0x2000 -#define BO_OPER 0x4000 -#define BO_REG 0x8000 -#define BO_SH 0x10000 -#define BO_SPELL 0x20000 -#define BO_WILD 0x40000 - -EXTERN char *p_bsk; // 'backupskip' -EXTERN char *p_breakat; // 'breakat' -EXTERN char *p_bh; ///< 'bufhidden' -EXTERN char *p_bt; ///< 'buftype' -EXTERN char *p_cmp; // 'casemap' -EXTERN unsigned cmp_flags; -#define CMP_INTERNAL 0x001 -#define CMP_KEEPASCII 0x002 -EXTERN char *p_enc; // 'encoding' -EXTERN int p_deco; // 'delcombine' -EXTERN char *p_ccv; // 'charconvert' -EXTERN char *p_cino; ///< 'cinoptions' -EXTERN char *p_cedit; // 'cedit' -EXTERN char *p_cb; // 'clipboard' -EXTERN unsigned cb_flags; -#define CB_UNNAMED 0x001 -#define CB_UNNAMEDPLUS 0x002 -#define CB_UNNAMEDMASK (CB_UNNAMED | CB_UNNAMEDPLUS) -EXTERN OptInt p_cwh; // 'cmdwinheight' -EXTERN OptInt p_ch; // 'cmdheight' -EXTERN char *p_cms; ///< 'commentstring' -EXTERN char *p_cpt; ///< 'complete' -EXTERN OptInt p_columns; // 'columns' -EXTERN int p_confirm; // 'confirm' -EXTERN char *p_cot; // 'completeopt' -#ifdef BACKSLASH_IN_FILENAME -EXTERN char *p_csl; // 'completeslash' -#endif -EXTERN OptInt p_pb; // 'pumblend' -EXTERN OptInt p_ph; // 'pumheight' -EXTERN OptInt p_pw; // 'pumwidth' -EXTERN char *p_com; ///< 'comments' -EXTERN char *p_cpo; // 'cpoptions' -EXTERN char *p_debug; // 'debug' -EXTERN char *p_def; // 'define' -EXTERN char *p_inc; -EXTERN char *p_dip; // 'diffopt' -EXTERN char *p_dex; // 'diffexpr' -EXTERN char *p_dict; // 'dictionary' -EXTERN int p_dg; // 'digraph' -EXTERN char *p_dir; // 'directory' -EXTERN char *p_dy; // 'display' -EXTERN unsigned dy_flags; -#define DY_LASTLINE 0x001 -#define DY_TRUNCATE 0x002 -#define DY_UHEX 0x004 -// legacy flag, not used -#define DY_MSGSEP 0x008 -EXTERN int p_ed; // 'edcompatible' -EXTERN char *p_ead; // 'eadirection' -EXTERN int p_emoji; // 'emoji' -EXTERN int p_ea; // 'equalalways' -EXTERN char *p_ep; // 'equalprg' -EXTERN int p_eb; // 'errorbells' -EXTERN char *p_ef; // 'errorfile' -EXTERN char *p_efm; // 'errorformat' -EXTERN char *p_gefm; // 'grepformat' -EXTERN char *p_gp; // 'grepprg' -EXTERN int p_eof; ///< 'endoffile' -EXTERN int p_eol; ///< 'endofline' -EXTERN char *p_ei; // 'eventignore' -EXTERN int p_et; ///< 'expandtab' -EXTERN int p_exrc; // 'exrc' -EXTERN char *p_fenc; ///< 'fileencoding' -EXTERN char *p_fencs; // 'fileencodings' -EXTERN char *p_ff; ///< 'fileformat' -EXTERN char *p_ffs; // 'fileformats' -EXTERN int p_fic; // 'fileignorecase' -EXTERN char *p_ft; ///< 'filetype' -EXTERN char *p_fcs; ///< 'fillchar' -EXTERN int p_fixeol; ///< 'fixendofline' -EXTERN char *p_fcl; // 'foldclose' -EXTERN OptInt p_fdls; // 'foldlevelstart' -EXTERN char *p_fdo; // 'foldopen' -EXTERN unsigned fdo_flags; -#define FDO_ALL 0x001 -#define FDO_BLOCK 0x002 -#define FDO_HOR 0x004 -#define FDO_MARK 0x008 -#define FDO_PERCENT 0x010 -#define FDO_QUICKFIX 0x020 -#define FDO_SEARCH 0x040 -#define FDO_TAG 0x080 -#define FDO_INSERT 0x100 -#define FDO_UNDO 0x200 -#define FDO_JUMP 0x400 -EXTERN char *p_fex; ///< 'formatexpr' -EXTERN char *p_flp; ///< 'formatlistpat' -EXTERN char *p_fo; ///< 'formatoptions' -EXTERN char *p_fp; // 'formatprg' -EXTERN int p_fs; // 'fsync' -EXTERN int p_gd; // 'gdefault' -EXTERN char *p_guicursor; // 'guicursor' -EXTERN char *p_guifont; // 'guifont' -EXTERN char *p_guifontwide; // 'guifontwide' -EXTERN char *p_hf; // 'helpfile' -EXTERN OptInt p_hh; // 'helpheight' -EXTERN char *p_hlg; // 'helplang' -EXTERN int p_hid; // 'hidden' -EXTERN char *p_hl; // 'highlight' -EXTERN int p_hls; // 'hlsearch' -EXTERN OptInt p_hi; // 'history' -EXTERN int p_arshape; // 'arabicshape' -EXTERN int p_icon; // 'icon' -EXTERN char *p_iconstring; // 'iconstring' -EXTERN int p_ic; // 'ignorecase' -EXTERN OptInt p_iminsert; ///< 'iminsert' -EXTERN OptInt p_imsearch; ///< 'imsearch' -EXTERN int p_inf; ///< 'infercase' -EXTERN char *p_inex; ///< 'includeexpr' -EXTERN int p_is; // 'incsearch' -EXTERN char *p_inde; ///< 'indentexpr' -EXTERN char *p_indk; ///< 'indentkeys' -EXTERN char *p_icm; // 'inccommand' -EXTERN char *p_isf; // 'isfname' -EXTERN char *p_isi; // 'isident' -EXTERN char *p_isk; ///< 'iskeyword' -EXTERN char *p_isp; // 'isprint' -EXTERN int p_js; // 'joinspaces' -EXTERN char *p_jop; // 'jumpooptions' -EXTERN unsigned jop_flags; -#define JOP_STACK 0x01 -#define JOP_VIEW 0x02 -EXTERN char *p_keymap; ///< 'keymap' -EXTERN char *p_kp; // 'keywordprg' -EXTERN char *p_km; // 'keymodel' -EXTERN char *p_langmap; // 'langmap' -EXTERN int p_lnr; // 'langnoremap' -EXTERN int p_lrm; // 'langremap' -EXTERN char *p_lm; // 'langmenu' -EXTERN OptInt p_lines; // 'lines' -EXTERN OptInt p_linespace; // 'linespace' -EXTERN int p_lisp; ///< 'lisp' -EXTERN char *p_lop; ///< 'lispoptions' -EXTERN char *p_lispwords; // 'lispwords' -EXTERN OptInt p_ls; // 'laststatus' -EXTERN OptInt p_stal; // 'showtabline' -EXTERN char *p_lcs; // 'listchars' - -EXTERN int p_lz; // 'lazyredraw' -EXTERN int p_lpl; // 'loadplugins' -EXTERN int p_magic; // 'magic' -EXTERN char *p_menc; // 'makeencoding' -EXTERN char *p_mef; // 'makeef' -EXTERN char *p_mp; // 'makeprg' -EXTERN char *p_mps; ///< 'matchpairs' -EXTERN OptInt p_mat; // 'matchtime' -EXTERN OptInt p_mco; // 'maxcombine' -EXTERN OptInt p_mfd; // 'maxfuncdepth' -EXTERN OptInt p_mmd; // 'maxmapdepth' -EXTERN OptInt p_mmp; // 'maxmempattern' -EXTERN OptInt p_mis; // 'menuitems' -EXTERN char *p_msm; // 'mkspellmem' -EXTERN int p_ml; ///< 'modeline' -EXTERN int p_mle; // 'modelineexpr' -EXTERN OptInt p_mls; // 'modelines' -EXTERN int p_ma; ///< 'modifiable' -EXTERN int p_mod; ///< 'modified' -EXTERN char *p_mouse; // 'mouse' -EXTERN char *p_mousem; // 'mousemodel' -EXTERN int p_mousemev; ///< 'mousemoveevent' -EXTERN int p_mousef; // 'mousefocus' -EXTERN char *p_mousescroll; // 'mousescroll' -EXTERN OptInt p_mousescroll_vert INIT(= MOUSESCROLL_VERT_DFLT); -EXTERN OptInt p_mousescroll_hor INIT(= MOUSESCROLL_HOR_DFLT); -EXTERN OptInt p_mouset; // 'mousetime' -EXTERN int p_more; // 'more' -EXTERN char *p_nf; ///< 'nrformats' -EXTERN char *p_opfunc; // 'operatorfunc' -EXTERN char *p_para; // 'paragraphs' -EXTERN int p_paste; // 'paste' -EXTERN char *p_pex; // 'patchexpr' -EXTERN char *p_pm; // 'patchmode' -EXTERN char *p_path; // 'path' -EXTERN char *p_cdpath; // 'cdpath' -EXTERN int p_pi; ///< 'preserveindent' -EXTERN OptInt p_pyx; // 'pyxversion' -EXTERN char *p_qe; ///< 'quoteescape' -EXTERN int p_ro; ///< 'readonly' -EXTERN char *p_rdb; // 'redrawdebug' -EXTERN unsigned rdb_flags; -#define RDB_COMPOSITOR 0x001 -#define RDB_NOTHROTTLE 0x002 -#define RDB_INVALID 0x004 -#define RDB_NODELTA 0x008 -#define RDB_LINE 0x010 -#define RDB_FLUSH 0x020 -#define RDB_INTERSECT 0x040 - -EXTERN OptInt p_rdt; // 'redrawtime' -EXTERN OptInt p_re; // 'regexpengine' -EXTERN OptInt p_report; // 'report' -EXTERN OptInt p_pvh; // 'previewheight' -EXTERN int p_ari; // 'allowrevins' -EXTERN int p_ri; // 'revins' -EXTERN int p_ru; // 'ruler' -EXTERN char *p_ruf; // 'rulerformat' -EXTERN char *p_pp; // 'packpath' -EXTERN char *p_qftf; // 'quickfixtextfunc' -EXTERN char *p_rtp; // 'runtimepath' -EXTERN OptInt p_scbk; // 'scrollback' -EXTERN OptInt p_sj; // 'scrolljump' -EXTERN OptInt p_so; // 'scrolloff' -EXTERN char *p_sbo; // 'scrollopt' -EXTERN char *p_sections; // 'sections' -EXTERN int p_secure; // 'secure' -EXTERN char *p_sel; // 'selection' -EXTERN char *p_slm; // 'selectmode' -EXTERN char *p_ssop; // 'sessionoptions' -EXTERN unsigned ssop_flags; - -#define SSOP_BUFFERS 0x001 -#define SSOP_WINPOS 0x002 -#define SSOP_RESIZE 0x004 -#define SSOP_WINSIZE 0x008 -#define SSOP_LOCALOPTIONS 0x010 -#define SSOP_OPTIONS 0x020 -#define SSOP_HELP 0x040 -#define SSOP_BLANK 0x080 -#define SSOP_GLOBALS 0x100 -#define SSOP_SLASH 0x200 // Deprecated, always set. -#define SSOP_UNIX 0x400 // Deprecated, always set. -#define SSOP_SESDIR 0x800 -#define SSOP_CURDIR 0x1000 -#define SSOP_FOLDS 0x2000 -#define SSOP_CURSOR 0x4000 -#define SSOP_TABPAGES 0x8000 -#define SSOP_TERMINAL 0x10000 -#define SSOP_SKIP_RTP 0x20000 - -EXTERN char *p_sh; // 'shell' -EXTERN char *p_shcf; // 'shellcmdflag' -EXTERN char *p_sp; // 'shellpipe' -EXTERN char *p_shq; // 'shellquote' -EXTERN char *p_sxq; // 'shellxquote' -EXTERN char *p_sxe; // 'shellxescape' -EXTERN char *p_srr; // 'shellredir' -EXTERN int p_stmp; // 'shelltemp' -#ifdef BACKSLASH_IN_FILENAME -EXTERN int p_ssl; // 'shellslash' -#endif -EXTERN char *p_stl; // 'statusline' -EXTERN char *p_wbr; // 'winbar' -EXTERN int p_sr; // 'shiftround' -EXTERN OptInt p_sw; ///< 'shiftwidth' -EXTERN char *p_shm; // 'shortmess' -EXTERN char *p_sbr; // 'showbreak' -EXTERN int p_sc; // 'showcmd' -EXTERN char *p_sloc; // 'showcmdloc' -EXTERN int p_sft; // 'showfulltag' -EXTERN int p_sm; // 'showmatch' -EXTERN int p_smd; // 'showmode' -EXTERN OptInt p_ss; // 'sidescroll' -EXTERN OptInt p_siso; // 'sidescrolloff' -EXTERN int p_scs; // 'smartcase' -EXTERN int p_si; ///< 'smartindent' -EXTERN int p_sta; // 'smarttab' -EXTERN OptInt p_sts; ///< 'softtabstop' -EXTERN int p_sb; // 'splitbelow' -EXTERN char *p_sua; ///< 'suffixesadd' -EXTERN int p_swf; ///< 'swapfile' -EXTERN OptInt p_smc; ///< 'synmaxcol' -EXTERN OptInt p_tpm; // 'tabpagemax' -EXTERN char *p_tal; // 'tabline' -EXTERN char *p_tpf; // 'termpastefilter' -EXTERN unsigned tpf_flags; ///< flags from 'termpastefilter' -#define TPF_BS 0x001 -#define TPF_HT 0x002 -#define TPF_FF 0x004 -#define TPF_ESC 0x008 -#define TPF_DEL 0x010 -#define TPF_C0 0x020 -#define TPF_C1 0x040 -EXTERN char *p_tfu; ///< 'tagfunc' -EXTERN char *p_spc; ///< 'spellcapcheck' -EXTERN char *p_spf; ///< 'spellfile' -EXTERN char *p_spk; ///< 'splitkeep' -EXTERN char *p_spl; ///< 'spelllang' -EXTERN char *p_spo; // 'spelloptions' -EXTERN unsigned spo_flags; -EXTERN char *p_sps; // 'spellsuggest' -EXTERN int p_spr; // 'splitright' -EXTERN int p_sol; // 'startofline' -EXTERN char *p_su; // 'suffixes' -EXTERN char *p_swb; // 'switchbuf' -EXTERN unsigned swb_flags; -// Keep in sync with p_swb_values in optionstr.c -#define SWB_USEOPEN 0x001 -#define SWB_USETAB 0x002 -#define SWB_SPLIT 0x004 -#define SWB_NEWTAB 0x008 -#define SWB_VSPLIT 0x010 -#define SWB_USELAST 0x020 -EXTERN char *p_syn; ///< 'syntax' -EXTERN OptInt p_ts; ///< 'tabstop' -EXTERN int p_tbs; ///< 'tagbsearch' -EXTERN char *p_tc; ///< 'tagcase' -EXTERN unsigned tc_flags; ///< flags from 'tagcase' -#define TC_FOLLOWIC 0x01 -#define TC_IGNORE 0x02 -#define TC_MATCH 0x04 -#define TC_FOLLOWSCS 0x08 -#define TC_SMART 0x10 -EXTERN OptInt p_tl; ///< 'taglength' -EXTERN int p_tr; ///< 'tagrelative' -EXTERN char *p_tags; ///< 'tags' -EXTERN int p_tgst; ///< 'tagstack' -EXTERN int p_tbidi; ///< 'termbidi' -EXTERN OptInt p_tw; ///< 'textwidth' -EXTERN int p_to; ///< 'tildeop' -EXTERN int p_timeout; ///< 'timeout' -EXTERN OptInt p_tm; ///< 'timeoutlen' -EXTERN int p_title; ///< 'title' -EXTERN OptInt p_titlelen; ///< 'titlelen' -EXTERN char *p_titleold; ///< 'titleold' -EXTERN char *p_titlestring; ///< 'titlestring' -EXTERN char *p_tsr; ///< 'thesaurus' -EXTERN int p_tgc; ///< 'termguicolors' -EXTERN int p_ttimeout; ///< 'ttimeout' -EXTERN OptInt p_ttm; ///< 'ttimeoutlen' -EXTERN char *p_udir; ///< 'undodir' -EXTERN int p_udf; ///< 'undofile' -EXTERN OptInt p_ul; ///< 'undolevels' -EXTERN OptInt p_ur; ///< 'undoreload' -EXTERN OptInt p_uc; ///< 'updatecount' -EXTERN OptInt p_ut; ///< 'updatetime' -EXTERN char *p_shada; ///< 'shada' -EXTERN char *p_shadafile; ///< 'shadafile' -EXTERN char *p_vsts; ///< 'varsofttabstop' -EXTERN char *p_vts; ///< 'vartabstop' -EXTERN char *p_vdir; ///< 'viewdir' -EXTERN char *p_vop; ///< 'viewoptions' -EXTERN unsigned vop_flags; ///< uses SSOP_ flags -EXTERN int p_vb; ///< 'visualbell' -EXTERN char *p_ve; ///< 'virtualedit' -EXTERN unsigned ve_flags; -#define VE_BLOCK 5U // includes "all" -#define VE_INSERT 6U // includes "all" -#define VE_ALL 4U -#define VE_ONEMORE 8U -#define VE_NONE 16U // "none" -#define VE_NONEU 32U // "NONE" -EXTERN OptInt p_verbose; // 'verbose' -#ifdef IN_OPTION_C -char *p_vfile = ""; // used before options are initialized -#else -extern char *p_vfile; // 'verbosefile' -#endif -EXTERN int p_warn; // 'warn' -EXTERN char *p_wop; // 'wildoptions' -EXTERN unsigned wop_flags; -#define WOP_TAGFILE 0x01 -#define WOP_PUM 0x02 -#define WOP_FUZZY 0x04 -EXTERN OptInt p_window; // 'window' -EXTERN char *p_wak; // 'winaltkeys' -EXTERN char *p_wig; // 'wildignore' -EXTERN char *p_ww; // 'whichwrap' -EXTERN OptInt p_wc; // 'wildchar' -EXTERN OptInt p_wcm; // 'wildcharm' -EXTERN int p_wic; // 'wildignorecase' -EXTERN char *p_wim; // 'wildmode' -EXTERN int p_wmnu; // 'wildmenu' -EXTERN OptInt p_wh; // 'winheight' -EXTERN OptInt p_wmh; // 'winminheight' -EXTERN OptInt p_wmw; // 'winminwidth' -EXTERN OptInt p_wiw; // 'winwidth' -EXTERN OptInt p_wm; ///< 'wrapmargin' -EXTERN int p_ws; // 'wrapscan' -EXTERN int p_write; // 'write' -EXTERN int p_wa; // 'writeany' -EXTERN int p_wb; // 'writebackup' -EXTERN OptInt p_wd; // 'writedelay' -EXTERN int p_cdh; // 'cdhome' - -EXTERN int p_force_on; ///< options that cannot be turned off. -EXTERN int p_force_off; ///< options that cannot be turned on. - -// -// "indir" values for buffer-local options. -// These need to be defined globally, so that the BV_COUNT can be used with -// b_p_scriptID[]. -// -enum { - BV_AI = 0, - BV_AR, - BV_BH, - BV_BKC, - BV_BT, - BV_EFM, - BV_GP, - BV_MP, - BV_BIN, - BV_BL, - BV_BOMB, - BV_CHANNEL, - BV_CI, - BV_CIN, - BV_CINK, - BV_CINO, - BV_CINW, - BV_CINSD, - BV_CM, - BV_CMS, - BV_COM, - BV_CPT, - BV_DICT, - BV_TSR, - BV_CSL, - BV_CFU, - BV_DEF, - BV_INC, - BV_EOF, - BV_EOL, - BV_FIXEOL, - BV_EP, - BV_ET, - BV_FENC, - BV_FP, - BV_BEXPR, - BV_FEX, - BV_FF, - BV_FLP, - BV_FO, - BV_FT, - BV_IMI, - BV_IMS, - BV_INDE, - BV_INDK, - BV_INEX, - BV_INF, - BV_ISK, - BV_KMAP, - BV_KP, - BV_LISP, - BV_LOP, - BV_LW, - BV_MENC, - BV_MA, - BV_ML, - BV_MOD, - BV_MPS, - BV_NF, - BV_OFU, - BV_PATH, - BV_PI, - BV_QE, - BV_RO, - BV_SCBK, - BV_SI, - BV_SMC, - BV_SYN, - BV_SPC, - BV_SPF, - BV_SPL, - BV_SPO, - BV_STS, - BV_SUA, - BV_SW, - BV_SWF, - BV_TFU, - BV_TSRFU, - BV_TAGS, - BV_TC, - BV_TS, - BV_TW, - BV_TX, - BV_UDF, - BV_UL, - BV_WM, - BV_VSTS, - BV_VTS, - BV_COUNT, // must be the last one -}; - -// "indir" values for window-local options. -// These need to be defined globally, so that the WV_COUNT can be used in the -// window structure. -enum { - WV_LIST = 0, - WV_ARAB, - WV_COCU, - WV_COLE, - WV_CRBIND, - WV_BRI, - WV_BRIOPT, - WV_DIFF, - WV_FDC, - WV_FEN, - WV_FDI, - WV_FDL, - WV_FDM, - WV_FML, - WV_FDN, - WV_FDE, - WV_FDT, - WV_FMR, - WV_LBR, - WV_NU, - WV_RNU, - WV_VE, - WV_NUW, - WV_PVW, - WV_RL, - WV_RLC, - WV_SCBIND, - WV_SCROLL, - WV_SMS, - WV_SISO, - WV_SO, - WV_SPELL, - WV_CUC, - WV_CUL, - WV_CULOPT, - WV_CC, - WV_SBR, - WV_STC, - WV_STL, - WV_WFH, - WV_WFW, - WV_WRAP, - WV_SCL, - WV_WINHL, - WV_LCS, - WV_FCS, - WV_WINBL, - WV_WBR, - WV_COUNT, // must be the last one -}; - -// Value for b_p_ul indicating the global value must be used. -#define NO_LOCAL_UNDOLEVEL (-123456) + kOptValTypeNil = 0, + kOptValTypeBoolean, + kOptValTypeNumber, + kOptValTypeString, +} OptValType; -#define SB_MAX 100000 // Maximum 'scrollback' value. +/// Option value +typedef struct { + OptValType type; -#define TABSTOP_MAX 9999 + union { + // boolean options are actually tri-states because they have a third "None" value. + TriState boolean; + OptInt number; + String string; + } data; +} OptVal; -// Argument for the callback function (opt_did_set_cb_T) invoked after an -// option value is modified. +/// Argument for the callback function (opt_did_set_cb_T) invoked after an +/// option value is modified. typedef struct { - // Pointer to the option variable. The variable can be an OptInt (numeric - // option), an int (boolean option) or a char pointer (string option). + /// Pointer to the option variable. The variable can be an OptInt (numeric + /// option), an int (boolean option) or a char pointer (string option). void *os_varp; int os_idx; int os_flags; - // old value of the option (can be a string, number or a boolean) + /// old value of the option (can be a string, number or a boolean) union { const OptInt number; const bool boolean; const char *string; } os_oldval; - // new value of the option (can be a string, number or a boolean) + /// new value of the option (can be a string, number or a boolean) union { const OptInt number; const bool boolean; const char *string; } os_newval; - // When set by the called function: Stop processing the option further. - // Currently only used for boolean options. - int os_doskip; + /// When set by the called function: Stop processing the option further. + /// Currently only used for boolean options. + bool os_doskip; - // Option value was checked to be safe, no need to set P_INSECURE - // Used for the 'keymap', 'filetype' and 'syntax' options. + /// Option value was checked to be safe, no need to set P_INSECURE + /// Used for the 'keymap', 'filetype' and 'syntax' options. bool os_value_checked; - // Option value changed. Used for the 'filetype' and 'syntax' options. + /// Option value changed. Used for the 'filetype' and 'syntax' options. bool os_value_changed; - // Used by the 'isident', 'iskeyword', 'isprint' and 'isfname' options. - // Set to true if the character table is modified when processing the - // option and need to be restored because of a failure. - int os_restore_chartab; + /// Used by the 'isident', 'iskeyword', 'isprint' and 'isfname' options. + /// Set to true if the character table is modified when processing the + /// option and need to be restored because of a failure. + bool os_restore_chartab; - // If the value specified for an option is not valid and the error message - // is parameterized, then the "os_errbuf" buffer is used to store the error - // message (when it is not NULL). + /// If the value specified for an option is not valid and the error message + /// is parameterized, then the "os_errbuf" buffer is used to store the error + /// message (when it is not NULL). char *os_errbuf; size_t os_errbuflen; @@ -1030,70 +80,4 @@ typedef struct { /// Otherwise returns an error message. typedef const char *(*opt_did_set_cb_T)(optset_T *args); -/// Stores an identifier of a script or channel that last set an option. -typedef struct { - sctx_T script_ctx; /// script context where the option was last set - uint64_t channel_id; /// Only used when script_id is SID_API_CLIENT. -} LastSet; - -// WV_ and BV_ values get typecasted to this for the "indir" field -typedef enum { - PV_NONE = 0, - PV_MAXVAL = 0xffff, // to avoid warnings for value out of range -} idopt_T; - -typedef struct vimoption { - char *fullname; // full option name - char *shortname; // permissible abbreviation - uint32_t flags; // see above - void *var; // global option: pointer to variable; - // window-local option: VAR_WIN; - // buffer-local option: global value - idopt_T indir; // global option: PV_NONE; - // local option: indirect option index - // callback function to invoke after an option is modified to validate and - // apply the new value. - opt_did_set_cb_T opt_did_set_cb; - void *def_val; // default values for variable (neovim!!) - LastSet last_set; // script in which the option was last set -} vimoption_T; - -// The options that are local to a window or buffer have "indir" set to one of -// these values. Special values: -// PV_NONE: global option. -// PV_WIN is added: window-local option -// PV_BUF is added: buffer-local option -// PV_BOTH is added: global option which also has a local value. -#define PV_BOTH 0x1000 -#define PV_WIN 0x2000 -#define PV_BUF 0x4000 -#define PV_MASK 0x0fff -#define OPT_WIN(x) (idopt_T)(PV_WIN + (int)(x)) -#define OPT_BUF(x) (idopt_T)(PV_BUF + (int)(x)) -#define OPT_BOTH(x) (idopt_T)(PV_BOTH + (int)(x)) - -// Options local to a window have a value local to a buffer and global to all -// buffers. Indicate this by setting "var" to VAR_WIN. -#define VAR_WIN ((char *)-1) - -// Option value type -typedef enum { - kOptValTypeNil = 0, - kOptValTypeBoolean, - kOptValTypeNumber, - kOptValTypeString, -} OptValType; - -// Option value -typedef struct { - OptValType type; - - union { - // Vim boolean options are actually tri-states because they have a third "None" value. - TriState boolean; - OptInt number; - String string; - } data; -} OptVal; - #endif // NVIM_OPTION_DEFS_H diff --git a/src/nvim/option_vars.h b/src/nvim/option_vars.h new file mode 100644 index 0000000000..d8bbce21b3 --- /dev/null +++ b/src/nvim/option_vars.h @@ -0,0 +1,946 @@ +#ifndef NVIM_OPTION_VARS_H +#define NVIM_OPTION_VARS_H + +#include "nvim/macros.h" +#include "nvim/types.h" + +// option_vars.h: definition of global variables for settable options + +// Option Flags +#define P_BOOL 0x01U ///< the option is boolean +#define P_NUM 0x02U ///< the option is numeric +#define P_STRING 0x04U ///< the option is a string +#define P_ALLOCED 0x08U ///< the string option is in allocated memory, + ///< must use free_string_option() when + ///< assigning new value. Not set if default is + ///< the same. +#define P_EXPAND 0x10U ///< environment expansion. NOTE: P_EXPAND can + ///< never be used for local or hidden options +#define P_NODEFAULT 0x40U ///< don't set to default value +#define P_DEF_ALLOCED 0x80U ///< default value is in allocated memory, must + ///< use free() when assigning new value +#define P_WAS_SET 0x100U ///< option has been set/reset +#define P_NO_MKRC 0x200U ///< don't include in :mkvimrc output + +// when option changed, what to display: +#define P_UI_OPTION 0x400U ///< send option to remote UI +#define P_RTABL 0x800U ///< redraw tabline +#define P_RSTAT 0x1000U ///< redraw status lines +#define P_RWIN 0x2000U ///< redraw current window and recompute text +#define P_RBUF 0x4000U ///< redraw current buffer and recompute text +#define P_RALL 0x6000U ///< redraw all windows +#define P_RCLR 0x7000U ///< clear and redraw all + +#define P_COMMA 0x8000U ///< comma separated list +#define P_ONECOMMA 0x18000U ///< P_COMMA and cannot have two consecutive + ///< commas +#define P_NODUP 0x20000U ///< don't allow duplicate strings +#define P_FLAGLIST 0x40000U ///< list of single-char flags + +#define P_SECURE 0x80000U ///< cannot change in modeline or secure mode +#define P_GETTEXT 0x100000U ///< expand default value with _() +#define P_NOGLOB 0x200000U ///< do not use local value for global vimrc +#define P_NFNAME 0x400000U ///< only normal file name chars allowed +#define P_INSECURE 0x800000U ///< option was set from a modeline +#define P_PRI_MKRC 0x1000000U ///< priority for :mkvimrc (setting option + ///< has side effects) +#define P_NO_ML 0x2000000U ///< not allowed in modeline +#define P_CURSWANT 0x4000000U ///< update curswant required; not needed + ///< when there is a redraw flag +#define P_NDNAME 0x8000000U ///< only normal dir name chars allowed +#define P_RWINONLY 0x10000000U ///< only redraw current window +#define P_MLE 0x20000000U ///< under control of 'modelineexpr' +#define P_FUNC 0x40000000U ///< accept a function reference or a lambda + +#define P_NO_DEF_EXP 0x80000000U ///< Do not expand default value. + +#define HIGHLIGHT_INIT \ + "8:SpecialKey,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText,d:Directory,e:ErrorMsg," \ + "i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow," \ + "N:CursorLineNr,G:CursorLineSign,O:CursorLineFold" \ + "r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg," \ + "W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn," \ + "-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel," \ + "[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb," \ + "*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn," \ + "q:QuickFixLine,0:Whitespace,I:NormalNC" + +// Default values for 'errorformat'. +// The "%f|%l| %m" one is used for when the contents of the quickfix window is +// written to a file. +#ifdef MSWIN +# define DFLT_EFM \ + "%f(%l) \\=: %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f(%l) \\=: %m,%*[^ ] %f %l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,%f|%l| %m" +#else +# define DFLT_EFM \ + "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-Gg%\\?make[%*\\d]: *** [%f:%l:%m,%-Gg%\\?make: *** [%f:%l:%m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c\\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory %*[`']%f',%X%*\\a[%*\\d]: Leaving directory %*[`']%f',%D%*\\a: Entering directory %*[`']%f',%X%*\\a: Leaving directory %*[`']%f',%DMaking %*\\a in %f,%f|%l| %m" +#endif + +#define DFLT_GREPFORMAT "%f:%l:%m,%f:%l%m,%f %l%m" + +// default values for b_p_ff 'fileformat' and p_ffs 'fileformats' +#define FF_DOS "dos" +#define FF_MAC "mac" +#define FF_UNIX "unix" + +#ifdef USE_CRNL +# define DFLT_FF "dos" +# define DFLT_FFS_VIM "dos,unix" +# define DFLT_FFS_VI "dos,unix" // also autodetect in compatible mode +#else +# define DFLT_FF "unix" +# define DFLT_FFS_VIM "unix,dos" +# define DFLT_FFS_VI "" +#endif + +// Possible values for 'encoding' +#define ENC_UCSBOM "ucs-bom" // check for BOM at start of file + +// default value for 'encoding' +#define ENC_DFLT "utf-8" + +// end-of-line style +#define EOL_UNKNOWN (-1) // not defined yet +#define EOL_UNIX 0 // NL +#define EOL_DOS 1 // CR NL +#define EOL_MAC 2 // CR + +// Formatting options for p_fo 'formatoptions' +#define FO_WRAP 't' +#define FO_WRAP_COMS 'c' +#define FO_RET_COMS 'r' +#define FO_OPEN_COMS 'o' +#define FO_NO_OPEN_COMS '/' +#define FO_Q_COMS 'q' +#define FO_Q_NUMBER 'n' +#define FO_Q_SECOND '2' +#define FO_INS_VI 'v' +#define FO_INS_LONG 'l' +#define FO_INS_BLANK 'b' +#define FO_MBYTE_BREAK 'm' // break before/after multi-byte char +#define FO_MBYTE_JOIN 'M' // no space before/after multi-byte char +#define FO_MBYTE_JOIN2 'B' // no space between multi-byte chars +#define FO_ONE_LETTER '1' +#define FO_WHITE_PAR 'w' // trailing white space continues paragr. +#define FO_AUTO 'a' // automatic formatting +#define FO_RIGOROUS_TW ']' // respect textwidth rigorously +#define FO_REMOVE_COMS 'j' // remove comment leaders when joining lines +#define FO_PERIOD_ABBR 'p' // don't break a single space after a period + +#define DFLT_FO_VI "vt" +#define DFLT_FO_VIM "tcqj" +#define FO_ALL "tcro/q2vlb1mMBn,aw]jp" // for do_set() + +// characters for the p_cpo option: +#define CPO_ALTREAD 'a' // ":read" sets alternate file name +#define CPO_ALTWRITE 'A' // ":write" sets alternate file name +#define CPO_BAR 'b' // "\|" ends a mapping +#define CPO_BSLASH 'B' // backslash in mapping is not special +#define CPO_SEARCH 'c' +#define CPO_CONCAT 'C' // Don't concatenate sourced lines +#define CPO_DOTTAG 'd' // "./tags" in 'tags' is in current dir +#define CPO_DIGRAPH 'D' // No digraph after "r", "f", etc. +#define CPO_EXECBUF 'e' +#define CPO_EMPTYREGION 'E' // operating on empty region is an error +#define CPO_FNAMER 'f' // set file name for ":r file" +#define CPO_FNAMEW 'F' // set file name for ":w file" +#define CPO_INTMOD 'i' // interrupt a read makes buffer modified +#define CPO_INDENT 'I' // remove auto-indent more often +#define CPO_ENDOFSENT 'J' // need two spaces to detect end of sentence +#define CPO_KOFFSET 'K' // don't wait for key code in mappings +#define CPO_LITERAL 'l' // take char after backslash in [] literal +#define CPO_LISTWM 'L' // 'list' changes wrapmargin +#define CPO_SHOWMATCH 'm' +#define CPO_MATCHBSL 'M' // "%" ignores use of backslashes +#define CPO_NUMCOL 'n' // 'number' column also used for text +#define CPO_LINEOFF 'o' +#define CPO_OVERNEW 'O' // silently overwrite new file +#define CPO_LISP 'p' // 'lisp' indenting +#define CPO_FNAMEAPP 'P' // set file name for ":w >>file" +#define CPO_JOINCOL 'q' // with "3J" use column after first join +#define CPO_REDO 'r' +#define CPO_REMMARK 'R' // remove marks when filtering +#define CPO_BUFOPT 's' +#define CPO_BUFOPTGLOB 'S' +#define CPO_TAGPAT 't' // tag pattern is used for "n" +#define CPO_UNDO 'u' // "u" undoes itself +#define CPO_BACKSPACE 'v' // "v" keep deleted text +#define CPO_FWRITE 'W' // "w!" doesn't overwrite readonly files +#define CPO_ESC 'x' +#define CPO_REPLCNT 'X' // "R" with a count only deletes chars once +#define CPO_YANK 'y' +#define CPO_KEEPRO 'Z' // don't reset 'readonly' on ":w!" +#define CPO_DOLLAR '$' +#define CPO_FILTER '!' +#define CPO_MATCH '%' +#define CPO_PLUS '+' // ":write file" resets 'modified' +#define CPO_REGAPPEND '>' // insert NL when appending to a register +#define CPO_SCOLON ';' // using "," and ";" will skip over char if + // cursor would not move +#define CPO_CHANGEW '_' // "cw" special-case +// default values for Vim and Vi +#define CPO_VIM "aABceFs_" +#define CPO_VI "aAbBcCdDeEfFiIJKlLmMnoOpPqrRsStuvWxXyZ$!%+>;_" + +// characters for p_ww option: +#define WW_ALL "bshl<>[],~" + +// characters for p_mouse option: +#define MOUSE_NORMAL 'n' // use mouse in Normal mode +#define MOUSE_VISUAL 'v' // use mouse in Visual/Select mode +#define MOUSE_INSERT 'i' // use mouse in Insert mode +#define MOUSE_COMMAND 'c' // use mouse in Command-line mode +#define MOUSE_HELP 'h' // use mouse in help buffers +#define MOUSE_RETURN 'r' // use mouse for hit-return message +#define MOUSE_A "nvich" // used for 'a' flag +#define MOUSE_ALL "anvichr" // all possible characters +#define MOUSE_NONE ' ' // don't use Visual selection +#define MOUSE_NONEF 'x' // forced modeless selection + +// default vertical and horizontal mouse scroll values. +// Note: This should be in sync with the default mousescroll option. +#define MOUSESCROLL_VERT_DFLT 3 +#define MOUSESCROLL_HOR_DFLT 6 + +#define COCU_ALL "nvic" // flags for 'concealcursor' + +/// characters for p_shm option: +enum { + SHM_RO = 'r', ///< Readonly. + SHM_MOD = 'm', ///< Modified. + SHM_LINES = 'l', ///< "L" instead of "lines". + SHM_WRI = 'w', ///< "[w]" instead of "written". + SHM_ABBREVIATIONS = 'a', ///< Use abbreviations from #SHM_ALL_ABBREVIATIONS. + SHM_WRITE = 'W', ///< Don't use "written" at all. + SHM_TRUNC = 't', ///< Truncate file messages. + SHM_TRUNCALL = 'T', ///< Truncate all messages. + SHM_OVER = 'o', ///< Overwrite file messages. + SHM_OVERALL = 'O', ///< Overwrite more messages. + SHM_SEARCH = 's', ///< No search hit bottom messages. + SHM_ATTENTION = 'A', ///< No ATTENTION messages. + SHM_INTRO = 'I', ///< Intro messages. + SHM_COMPLETIONMENU = 'c', ///< Completion menu messages. + SHM_COMPLETIONSCAN = 'C', ///< Completion scanning messages. + SHM_RECORDING = 'q', ///< Short recording message. + SHM_FILEINFO = 'F', ///< No file info messages. + SHM_SEARCHCOUNT = 'S', ///< No search stats: '[1/10]' +}; +/// Represented by 'a' flag. +#define SHM_ALL_ABBREVIATIONS ((char[]) { \ + SHM_RO, SHM_MOD, SHM_LINES, SHM_WRI, \ + 0 }) + +// characters for p_go: +#define GO_ASEL 'a' // autoselect +#define GO_ASELML 'A' // autoselect modeless selection +#define GO_BOT 'b' // use bottom scrollbar +#define GO_CONDIALOG 'c' // use console dialog +#define GO_DARKTHEME 'd' // use dark theme variant +#define GO_TABLINE 'e' // may show tabline +#define GO_FORG 'f' // start GUI in foreground +#define GO_GREY 'g' // use grey menu items +#define GO_HORSCROLL 'h' // flexible horizontal scrolling +#define GO_ICON 'i' // use Vim icon +#define GO_LEFT 'l' // use left scrollbar +#define GO_VLEFT 'L' // left scrollbar with vert split +#define GO_MENUS 'm' // use menu bar +#define GO_NOSYSMENU 'M' // don't source system menu +#define GO_POINTER 'p' // pointer enter/leave callbacks +#define GO_ASELPLUS 'P' // autoselectPlus +#define GO_RIGHT 'r' // use right scrollbar +#define GO_VRIGHT 'R' // right scrollbar with vert split +#define GO_TOOLBAR 'T' // add toolbar +#define GO_FOOTER 'F' // add footer +#define GO_VERTICAL 'v' // arrange dialog buttons vertically +#define GO_KEEPWINSIZE 'k' // keep GUI window size +#define GO_ALL "!aAbcdefFghilLmMpPrRtTvk" // all possible flags for 'go' + +// flags for 'comments' option +#define COM_NEST 'n' // comments strings nest +#define COM_BLANK 'b' // needs blank after string +#define COM_START 's' // start of comment +#define COM_MIDDLE 'm' // middle of comment +#define COM_END 'e' // end of comment +#define COM_AUTO_END 'x' // last char of end closes comment +#define COM_FIRST 'f' // first line comment only +#define COM_LEFT 'l' // left adjusted +#define COM_RIGHT 'r' // right adjusted +#define COM_NOBACK 'O' // don't use for "O" command +#define COM_ALL "nbsmexflrO" // all flags for 'comments' option +#define COM_MAX_LEN 50 // maximum length of a part + +/// 'statusline' option flags +enum { + STL_FILEPATH = 'f', ///< Path of file in buffer. + STL_FULLPATH = 'F', ///< Full path of file in buffer. + STL_FILENAME = 't', ///< Last part (tail) of file path. + STL_COLUMN = 'c', ///< Column og cursor. + STL_VIRTCOL = 'v', ///< Virtual column. + STL_VIRTCOL_ALT = 'V', ///< - with 'if different' display. + STL_LINE = 'l', ///< Line number of cursor. + STL_NUMLINES = 'L', ///< Number of lines in buffer. + STL_BUFNO = 'n', ///< Current buffer number. + STL_KEYMAP = 'k', ///< 'keymap' when active. + STL_OFFSET = 'o', ///< Offset of character under cursor. + STL_OFFSET_X = 'O', ///< - in hexadecimal. + STL_BYTEVAL = 'b', ///< Byte value of character. + STL_BYTEVAL_X = 'B', ///< - in hexadecimal. + STL_ROFLAG = 'r', ///< Readonly flag. + STL_ROFLAG_ALT = 'R', ///< - other display. + STL_HELPFLAG = 'h', ///< Window is showing a help file. + STL_HELPFLAG_ALT = 'H', ///< - other display. + STL_FILETYPE = 'y', ///< 'filetype'. + STL_FILETYPE_ALT = 'Y', ///< - other display. + STL_PREVIEWFLAG = 'w', ///< Window is showing the preview buf. + STL_PREVIEWFLAG_ALT = 'W', ///< - other display. + STL_MODIFIED = 'm', ///< Modified flag. + STL_MODIFIED_ALT = 'M', ///< - other display. + STL_QUICKFIX = 'q', ///< Quickfix window description. + STL_PERCENTAGE = 'p', ///< Percentage through file. + STL_ALTPERCENT = 'P', ///< Percentage as TOP BOT ALL or NN%. + STL_ARGLISTSTAT = 'a', ///< Argument list status as (x of y). + STL_PAGENUM = 'N', ///< Page number (when printing). + STL_SHOWCMD = 'S', ///< 'showcmd' buffer + STL_FOLDCOL = 'C', ///< Fold column for 'statuscolumn' + STL_SIGNCOL = 's', ///< Sign column for 'statuscolumn' + STL_VIM_EXPR = '{', ///< Start of expression to substitute. + STL_SEPARATE = '=', ///< Separation between alignment sections. + STL_TRUNCMARK = '<', ///< Truncation mark if line is too long. + STL_USER_HL = '*', ///< Highlight from (User)1..9 or 0. + STL_HIGHLIGHT = '#', ///< Highlight name. + STL_TABPAGENR = 'T', ///< Tab page label nr. + STL_TABCLOSENR = 'X', ///< Tab page close nr. + STL_CLICK_FUNC = '@', ///< Click region start. +}; +/// C string containing all 'statusline' option flags +#define STL_ALL ((char[]) { \ + STL_FILEPATH, STL_FULLPATH, STL_FILENAME, STL_COLUMN, STL_VIRTCOL, \ + STL_VIRTCOL_ALT, STL_LINE, STL_NUMLINES, STL_BUFNO, STL_KEYMAP, STL_OFFSET, \ + STL_OFFSET_X, STL_BYTEVAL, STL_BYTEVAL_X, STL_ROFLAG, STL_ROFLAG_ALT, \ + STL_HELPFLAG, STL_HELPFLAG_ALT, STL_FILETYPE, STL_FILETYPE_ALT, \ + STL_PREVIEWFLAG, STL_PREVIEWFLAG_ALT, STL_MODIFIED, STL_MODIFIED_ALT, \ + STL_QUICKFIX, STL_PERCENTAGE, STL_ALTPERCENT, STL_ARGLISTSTAT, STL_PAGENUM, \ + STL_SHOWCMD, STL_FOLDCOL, STL_SIGNCOL, STL_VIM_EXPR, STL_SEPARATE, \ + STL_TRUNCMARK, STL_USER_HL, STL_HIGHLIGHT, STL_TABPAGENR, STL_TABCLOSENR, \ + STL_CLICK_FUNC, STL_TABPAGENR, STL_TABCLOSENR, STL_CLICK_FUNC, \ + 0, }) + +// flags used for parsed 'wildmode' +#define WIM_FULL 0x01 +#define WIM_LONGEST 0x02 +#define WIM_LIST 0x04 +#define WIM_BUFLASTUSED 0x08 + +// arguments for can_bs() +// each defined char should be unique over all values +// except for BS_START, that intentionally also matches BS_NOSTOP +// because BS_NOSTOP behaves exactly the same except it +// does not stop at the start of the insert point +#define BS_INDENT 'i' // "Indent" +#define BS_EOL 'l' // "eoL" +#define BS_START 's' // "Start" +#define BS_NOSTOP 'p' // "nostoP + +// flags for the 'culopt' option +#define CULOPT_LINE 0x01 // Highlight complete line +#define CULOPT_SCRLINE 0x02 // Highlight screen line +#define CULOPT_NBR 0x04 // Highlight Number column + +#define LISPWORD_VALUE \ + "defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defclass,defmethod,print-unreadable-object" + +// The following are actual variables for the options + +EXTERN char *p_ambw; ///< 'ambiwidth' +EXTERN int p_acd; ///< 'autochdir' +EXTERN int p_ai; ///< 'autoindent' +EXTERN int p_bin; ///< 'binary' +EXTERN int p_bomb; ///< 'bomb' +EXTERN int p_bl; ///< 'buflisted' +EXTERN int p_cin; ///< 'cindent' +EXTERN OptInt p_channel; ///< 'channel' +EXTERN char *p_cink; ///< 'cinkeys' +EXTERN char *p_cinsd; ///< 'cinscopedecls' +EXTERN char *p_cinw; ///< 'cinwords' +EXTERN char *p_cfu; ///< 'completefunc' +EXTERN char *p_ofu; ///< 'omnifunc' +EXTERN char *p_tsrfu; ///< 'thesaurusfunc' +EXTERN int p_ci; ///< 'copyindent' +EXTERN int p_ar; ///< 'autoread' +EXTERN int p_aw; ///< 'autowrite' +EXTERN int p_awa; ///< 'autowriteall' +EXTERN char *p_bs; ///< 'backspace' +EXTERN char *p_bg; ///< 'background' +EXTERN int p_bk; ///< 'backup' +EXTERN char *p_bkc; ///< 'backupcopy' +EXTERN unsigned bkc_flags; ///< flags from 'backupcopy' +#define BKC_YES 0x001 +#define BKC_AUTO 0x002 +#define BKC_NO 0x004 +#define BKC_BREAKSYMLINK 0x008 +#define BKC_BREAKHARDLINK 0x010 +EXTERN char *p_bdir; ///< 'backupdir' +EXTERN char *p_bex; ///< 'backupext' +EXTERN char *p_bo; ///< 'belloff' +EXTERN char breakat_flags[256]; ///< which characters are in 'breakat' +EXTERN unsigned bo_flags; + +// values for the 'belloff' option +#define BO_ALL 0x0001 +#define BO_BS 0x0002 +#define BO_CRSR 0x0004 +#define BO_COMPL 0x0008 +#define BO_COPY 0x0010 +#define BO_CTRLG 0x0020 +#define BO_ERROR 0x0040 +#define BO_ESC 0x0080 +#define BO_EX 0x0100 +#define BO_HANGUL 0x0200 +#define BO_IM 0x0400 +#define BO_LANG 0x0800 +#define BO_MESS 0x1000 +#define BO_MATCH 0x2000 +#define BO_OPER 0x4000 +#define BO_REG 0x8000 +#define BO_SH 0x10000 +#define BO_SPELL 0x20000 +#define BO_WILD 0x40000 + +EXTERN char *p_bsk; ///< 'backupskip' +EXTERN char *p_breakat; ///< 'breakat' +EXTERN char *p_bh; ///< 'bufhidden' +EXTERN char *p_bt; ///< 'buftype' +EXTERN char *p_cmp; ///< 'casemap' +EXTERN unsigned cmp_flags; +#define CMP_INTERNAL 0x001 +#define CMP_KEEPASCII 0x002 +EXTERN char *p_enc; ///< 'encoding' +EXTERN int p_deco; ///< 'delcombine' +EXTERN char *p_ccv; ///< 'charconvert' +EXTERN char *p_cino; ///< 'cinoptions' +EXTERN char *p_cedit; ///< 'cedit' +EXTERN char *p_cb; ///< 'clipboard' +EXTERN unsigned cb_flags; +#define CB_UNNAMED 0x001 +#define CB_UNNAMEDPLUS 0x002 +#define CB_UNNAMEDMASK (CB_UNNAMED | CB_UNNAMEDPLUS) +EXTERN OptInt p_cwh; ///< 'cmdwinheight' +EXTERN OptInt p_ch; ///< 'cmdheight' +EXTERN char *p_cms; ///< 'commentstring' +EXTERN char *p_cpt; ///< 'complete' +EXTERN OptInt p_columns; ///< 'columns' +EXTERN int p_confirm; ///< 'confirm' +EXTERN char *p_cot; ///< 'completeopt' +#ifdef BACKSLASH_IN_FILENAME +EXTERN char *p_csl; ///< 'completeslash' +#endif +EXTERN OptInt p_pb; ///< 'pumblend' +EXTERN OptInt p_ph; ///< 'pumheight' +EXTERN OptInt p_pw; ///< 'pumwidth' +EXTERN char *p_com; ///< 'comments' +EXTERN char *p_cpo; ///< 'cpoptions' +EXTERN char *p_debug; ///< 'debug' +EXTERN char *p_def; ///< 'define' +EXTERN char *p_inc; +EXTERN char *p_dip; ///< 'diffopt' +EXTERN char *p_dex; ///< 'diffexpr' +EXTERN char *p_dict; ///< 'dictionary' +EXTERN int p_dg; ///< 'digraph' +EXTERN char *p_dir; ///< 'directory' +EXTERN char *p_dy; ///< 'display' +EXTERN unsigned dy_flags; +#define DY_LASTLINE 0x001 +#define DY_TRUNCATE 0x002 +#define DY_UHEX 0x004 +// legacy flag, not used +#define DY_MSGSEP 0x008 +EXTERN int p_ed; ///< 'edcompatible' +EXTERN char *p_ead; ///< 'eadirection' +EXTERN int p_emoji; ///< 'emoji' +EXTERN int p_ea; ///< 'equalalways' +EXTERN char *p_ep; ///< 'equalprg' +EXTERN int p_eb; ///< 'errorbells' +EXTERN char *p_ef; ///< 'errorfile' +EXTERN char *p_efm; ///< 'errorformat' +EXTERN char *p_gefm; ///< 'grepformat' +EXTERN char *p_gp; ///< 'grepprg' +EXTERN int p_eof; ///< 'endoffile' +EXTERN int p_eol; ///< 'endofline' +EXTERN char *p_ei; ///< 'eventignore' +EXTERN int p_et; ///< 'expandtab' +EXTERN int p_exrc; ///< 'exrc' +EXTERN char *p_fenc; ///< 'fileencoding' +EXTERN char *p_fencs; ///< 'fileencodings' +EXTERN char *p_ff; ///< 'fileformat' +EXTERN char *p_ffs; ///< 'fileformats' +EXTERN int p_fic; ///< 'fileignorecase' +EXTERN char *p_ft; ///< 'filetype' +EXTERN char *p_fcs; ///< 'fillchar' +EXTERN int p_fixeol; ///< 'fixendofline' +EXTERN char *p_fcl; ///< 'foldclose' +EXTERN OptInt p_fdls; ///< 'foldlevelstart' +EXTERN char *p_fdo; ///< 'foldopen' +EXTERN unsigned fdo_flags; +#define FDO_ALL 0x001 +#define FDO_BLOCK 0x002 +#define FDO_HOR 0x004 +#define FDO_MARK 0x008 +#define FDO_PERCENT 0x010 +#define FDO_QUICKFIX 0x020 +#define FDO_SEARCH 0x040 +#define FDO_TAG 0x080 +#define FDO_INSERT 0x100 +#define FDO_UNDO 0x200 +#define FDO_JUMP 0x400 +EXTERN char *p_fex; ///< 'formatexpr' +EXTERN char *p_flp; ///< 'formatlistpat' +EXTERN char *p_fo; ///< 'formatoptions' +EXTERN char *p_fp; ///< 'formatprg' +EXTERN int p_fs; ///< 'fsync' +EXTERN int p_gd; ///< 'gdefault' +EXTERN char *p_guicursor; ///< 'guicursor' +EXTERN char *p_guifont; ///< 'guifont' +EXTERN char *p_guifontwide; ///< 'guifontwide' +EXTERN char *p_hf; ///< 'helpfile' +EXTERN OptInt p_hh; ///< 'helpheight' +EXTERN char *p_hlg; ///< 'helplang' +EXTERN int p_hid; ///< 'hidden' +EXTERN char *p_hl; ///< 'highlight' +EXTERN int p_hls; ///< 'hlsearch' +EXTERN OptInt p_hi; ///< 'history' +EXTERN int p_arshape; ///< 'arabicshape' +EXTERN int p_icon; ///< 'icon' +EXTERN char *p_iconstring; ///< 'iconstring' +EXTERN int p_ic; ///< 'ignorecase' +EXTERN OptInt p_iminsert; ///< 'iminsert' +EXTERN OptInt p_imsearch; ///< 'imsearch' +EXTERN int p_inf; ///< 'infercase' +EXTERN char *p_inex; ///< 'includeexpr' +EXTERN int p_is; ///< 'incsearch' +EXTERN char *p_inde; ///< 'indentexpr' +EXTERN char *p_indk; ///< 'indentkeys' +EXTERN char *p_icm; ///< 'inccommand' +EXTERN char *p_isf; ///< 'isfname' +EXTERN char *p_isi; ///< 'isident' +EXTERN char *p_isk; ///< 'iskeyword' +EXTERN char *p_isp; ///< 'isprint' +EXTERN int p_js; ///< 'joinspaces' +EXTERN char *p_jop; ///< 'jumpooptions' +EXTERN unsigned jop_flags; +#define JOP_STACK 0x01 +#define JOP_VIEW 0x02 +EXTERN char *p_keymap; ///< 'keymap' +EXTERN char *p_kp; ///< 'keywordprg' +EXTERN char *p_km; ///< 'keymodel' +EXTERN char *p_langmap; ///< 'langmap' +EXTERN int p_lnr; ///< 'langnoremap' +EXTERN int p_lrm; ///< 'langremap' +EXTERN char *p_lm; ///< 'langmenu' +EXTERN OptInt p_lines; ///< 'lines' +EXTERN OptInt p_linespace; ///< 'linespace' +EXTERN int p_lisp; ///< 'lisp' +EXTERN char *p_lop; ///< 'lispoptions' +EXTERN char *p_lispwords; ///< 'lispwords' +EXTERN OptInt p_ls; ///< 'laststatus' +EXTERN OptInt p_stal; ///< 'showtabline' +EXTERN char *p_lcs; ///< 'listchars' + +EXTERN int p_lz; ///< 'lazyredraw' +EXTERN int p_lpl; ///< 'loadplugins' +EXTERN int p_magic; ///< 'magic' +EXTERN char *p_menc; ///< 'makeencoding' +EXTERN char *p_mef; ///< 'makeef' +EXTERN char *p_mp; ///< 'makeprg' +EXTERN char *p_mps; ///< 'matchpairs' +EXTERN OptInt p_mat; ///< 'matchtime' +EXTERN OptInt p_mco; ///< 'maxcombine' +EXTERN OptInt p_mfd; ///< 'maxfuncdepth' +EXTERN OptInt p_mmd; ///< 'maxmapdepth' +EXTERN OptInt p_mmp; ///< 'maxmempattern' +EXTERN OptInt p_mis; ///< 'menuitems' +EXTERN char *p_msm; ///< 'mkspellmem' +EXTERN int p_ml; ///< 'modeline' +EXTERN int p_mle; ///< 'modelineexpr' +EXTERN OptInt p_mls; ///< 'modelines' +EXTERN int p_ma; ///< 'modifiable' +EXTERN int p_mod; ///< 'modified' +EXTERN char *p_mouse; ///< 'mouse' +EXTERN char *p_mousem; ///< 'mousemodel' +EXTERN int p_mousemev; ///< 'mousemoveevent' +EXTERN int p_mousef; ///< 'mousefocus' +EXTERN char *p_mousescroll; ///< 'mousescroll' +EXTERN OptInt p_mousescroll_vert INIT(= MOUSESCROLL_VERT_DFLT); +EXTERN OptInt p_mousescroll_hor INIT(= MOUSESCROLL_HOR_DFLT); +EXTERN OptInt p_mouset; ///< 'mousetime' +EXTERN int p_more; ///< 'more' +EXTERN char *p_nf; ///< 'nrformats' +EXTERN char *p_opfunc; ///< 'operatorfunc' +EXTERN char *p_para; ///< 'paragraphs' +EXTERN int p_paste; ///< 'paste' +EXTERN char *p_pex; ///< 'patchexpr' +EXTERN char *p_pm; ///< 'patchmode' +EXTERN char *p_path; ///< 'path' +EXTERN char *p_cdpath; ///< 'cdpath' +EXTERN int p_pi; ///< 'preserveindent' +EXTERN OptInt p_pyx; ///< 'pyxversion' +EXTERN char *p_qe; ///< 'quoteescape' +EXTERN int p_ro; ///< 'readonly' +EXTERN char *p_rdb; ///< 'redrawdebug' +EXTERN unsigned rdb_flags; +#define RDB_COMPOSITOR 0x001 +#define RDB_NOTHROTTLE 0x002 +#define RDB_INVALID 0x004 +#define RDB_NODELTA 0x008 +#define RDB_LINE 0x010 +#define RDB_FLUSH 0x020 +#define RDB_INTERSECT 0x040 + +EXTERN OptInt p_rdt; ///< 'redrawtime' +EXTERN OptInt p_re; ///< 'regexpengine' +EXTERN OptInt p_report; ///< 'report' +EXTERN OptInt p_pvh; ///< 'previewheight' +EXTERN int p_ari; ///< 'allowrevins' +EXTERN int p_ri; ///< 'revins' +EXTERN int p_ru; ///< 'ruler' +EXTERN char *p_ruf; ///< 'rulerformat' +EXTERN char *p_pp; ///< 'packpath' +EXTERN char *p_qftf; ///< 'quickfixtextfunc' +EXTERN char *p_rtp; ///< 'runtimepath' +EXTERN OptInt p_scbk; ///< 'scrollback' +EXTERN OptInt p_sj; ///< 'scrolljump' +EXTERN OptInt p_so; ///< 'scrolloff' +EXTERN char *p_sbo; ///< 'scrollopt' +EXTERN char *p_sections; ///< 'sections' +EXTERN int p_secure; ///< 'secure' +EXTERN char *p_sel; ///< 'selection' +EXTERN char *p_slm; ///< 'selectmode' +EXTERN char *p_ssop; ///< 'sessionoptions' +EXTERN unsigned ssop_flags; + +#define SSOP_BUFFERS 0x001 +#define SSOP_WINPOS 0x002 +#define SSOP_RESIZE 0x004 +#define SSOP_WINSIZE 0x008 +#define SSOP_LOCALOPTIONS 0x010 +#define SSOP_OPTIONS 0x020 +#define SSOP_HELP 0x040 +#define SSOP_BLANK 0x080 +#define SSOP_GLOBALS 0x100 +#define SSOP_SLASH 0x200 // Deprecated, always set. +#define SSOP_UNIX 0x400 // Deprecated, always set. +#define SSOP_SESDIR 0x800 +#define SSOP_CURDIR 0x1000 +#define SSOP_FOLDS 0x2000 +#define SSOP_CURSOR 0x4000 +#define SSOP_TABPAGES 0x8000 +#define SSOP_TERMINAL 0x10000 +#define SSOP_SKIP_RTP 0x20000 + +EXTERN char *p_sh; ///< 'shell' +EXTERN char *p_shcf; ///< 'shellcmdflag' +EXTERN char *p_sp; ///< 'shellpipe' +EXTERN char *p_shq; ///< 'shellquote' +EXTERN char *p_sxq; ///< 'shellxquote' +EXTERN char *p_sxe; ///< 'shellxescape' +EXTERN char *p_srr; ///< 'shellredir' +EXTERN int p_stmp; ///< 'shelltemp' +#ifdef BACKSLASH_IN_FILENAME +EXTERN int p_ssl; ///< 'shellslash' +#endif +EXTERN char *p_stl; ///< 'statusline' +EXTERN char *p_wbr; ///< 'winbar' +EXTERN int p_sr; ///< 'shiftround' +EXTERN OptInt p_sw; ///< 'shiftwidth' +EXTERN char *p_shm; ///< 'shortmess' +EXTERN char *p_sbr; ///< 'showbreak' +EXTERN int p_sc; ///< 'showcmd' +EXTERN char *p_sloc; ///< 'showcmdloc' +EXTERN int p_sft; ///< 'showfulltag' +EXTERN int p_sm; ///< 'showmatch' +EXTERN int p_smd; ///< 'showmode' +EXTERN OptInt p_ss; ///< 'sidescroll' +EXTERN OptInt p_siso; ///< 'sidescrolloff' +EXTERN int p_scs; ///< 'smartcase' +EXTERN int p_si; ///< 'smartindent' +EXTERN int p_sta; ///< 'smarttab' +EXTERN OptInt p_sts; ///< 'softtabstop' +EXTERN int p_sb; ///< 'splitbelow' +EXTERN char *p_sua; ///< 'suffixesadd' +EXTERN int p_swf; ///< 'swapfile' +EXTERN OptInt p_smc; ///< 'synmaxcol' +EXTERN OptInt p_tpm; ///< 'tabpagemax' +EXTERN char *p_tal; ///< 'tabline' +EXTERN char *p_tpf; ///< 'termpastefilter' +EXTERN unsigned tpf_flags; ///< flags from 'termpastefilter' +#define TPF_BS 0x001 +#define TPF_HT 0x002 +#define TPF_FF 0x004 +#define TPF_ESC 0x008 +#define TPF_DEL 0x010 +#define TPF_C0 0x020 +#define TPF_C1 0x040 +EXTERN char *p_tfu; ///< 'tagfunc' +EXTERN char *p_spc; ///< 'spellcapcheck' +EXTERN char *p_spf; ///< 'spellfile' +EXTERN char *p_spk; ///< 'splitkeep' +EXTERN char *p_spl; ///< 'spelllang' +EXTERN char *p_spo; ///< 'spelloptions' +EXTERN unsigned spo_flags; +EXTERN char *p_sps; ///< 'spellsuggest' +EXTERN int p_spr; ///< 'splitright' +EXTERN int p_sol; ///< 'startofline' +EXTERN char *p_su; ///< 'suffixes' +EXTERN char *p_swb; ///< 'switchbuf' +EXTERN unsigned swb_flags; +// Keep in sync with p_swb_values in optionstr.c +#define SWB_USEOPEN 0x001 +#define SWB_USETAB 0x002 +#define SWB_SPLIT 0x004 +#define SWB_NEWTAB 0x008 +#define SWB_VSPLIT 0x010 +#define SWB_USELAST 0x020 +EXTERN char *p_syn; ///< 'syntax' +EXTERN OptInt p_ts; ///< 'tabstop' +EXTERN int p_tbs; ///< 'tagbsearch' +EXTERN char *p_tc; ///< 'tagcase' +EXTERN unsigned tc_flags; ///< flags from 'tagcase' +#define TC_FOLLOWIC 0x01 +#define TC_IGNORE 0x02 +#define TC_MATCH 0x04 +#define TC_FOLLOWSCS 0x08 +#define TC_SMART 0x10 +EXTERN OptInt p_tl; ///< 'taglength' +EXTERN int p_tr; ///< 'tagrelative' +EXTERN char *p_tags; ///< 'tags' +EXTERN int p_tgst; ///< 'tagstack' +EXTERN int p_tbidi; ///< 'termbidi' +EXTERN OptInt p_tw; ///< 'textwidth' +EXTERN int p_to; ///< 'tildeop' +EXTERN int p_timeout; ///< 'timeout' +EXTERN OptInt p_tm; ///< 'timeoutlen' +EXTERN int p_title; ///< 'title' +EXTERN OptInt p_titlelen; ///< 'titlelen' +EXTERN char *p_titleold; ///< 'titleold' +EXTERN char *p_titlestring; ///< 'titlestring' +EXTERN char *p_tsr; ///< 'thesaurus' +EXTERN int p_tgc; ///< 'termguicolors' +EXTERN int p_ttimeout; ///< 'ttimeout' +EXTERN OptInt p_ttm; ///< 'ttimeoutlen' +EXTERN char *p_udir; ///< 'undodir' +EXTERN int p_udf; ///< 'undofile' +EXTERN OptInt p_ul; ///< 'undolevels' +EXTERN OptInt p_ur; ///< 'undoreload' +EXTERN OptInt p_uc; ///< 'updatecount' +EXTERN OptInt p_ut; ///< 'updatetime' +EXTERN char *p_shada; ///< 'shada' +EXTERN char *p_shadafile; ///< 'shadafile' +EXTERN char *p_vsts; ///< 'varsofttabstop' +EXTERN char *p_vts; ///< 'vartabstop' +EXTERN char *p_vdir; ///< 'viewdir' +EXTERN char *p_vop; ///< 'viewoptions' +EXTERN unsigned vop_flags; ///< uses SSOP_ flags +EXTERN int p_vb; ///< 'visualbell' +EXTERN char *p_ve; ///< 'virtualedit' +EXTERN unsigned ve_flags; +#define VE_BLOCK 5U // includes "all" +#define VE_INSERT 6U // includes "all" +#define VE_ALL 4U +#define VE_ONEMORE 8U +#define VE_NONE 16U // "none" +#define VE_NONEU 32U // "NONE" +EXTERN OptInt p_verbose; ///< 'verbose' +#ifdef IN_OPTION_C +char *p_vfile = ""; ///< used before options are initialized +#else +extern char *p_vfile; ///< 'verbosefile' +#endif +EXTERN int p_warn; ///< 'warn' +EXTERN char *p_wop; ///< 'wildoptions' +EXTERN unsigned wop_flags; +#define WOP_TAGFILE 0x01 +#define WOP_PUM 0x02 +#define WOP_FUZZY 0x04 +EXTERN OptInt p_window; ///< 'window' +EXTERN char *p_wak; ///< 'winaltkeys' +EXTERN char *p_wig; ///< 'wildignore' +EXTERN char *p_ww; ///< 'whichwrap' +EXTERN OptInt p_wc; ///< 'wildchar' +EXTERN OptInt p_wcm; ///< 'wildcharm' +EXTERN int p_wic; ///< 'wildignorecase' +EXTERN char *p_wim; ///< 'wildmode' +EXTERN int p_wmnu; ///< 'wildmenu' +EXTERN OptInt p_wh; ///< 'winheight' +EXTERN OptInt p_wmh; ///< 'winminheight' +EXTERN OptInt p_wmw; ///< 'winminwidth' +EXTERN OptInt p_wiw; ///< 'winwidth' +EXTERN OptInt p_wm; ///< 'wrapmargin' +EXTERN int p_ws; ///< 'wrapscan' +EXTERN int p_write; ///< 'write' +EXTERN int p_wa; ///< 'writeany' +EXTERN int p_wb; ///< 'writebackup' +EXTERN OptInt p_wd; ///< 'writedelay' +EXTERN int p_cdh; ///< 'cdhome' + +EXTERN int p_force_on; ///< options that cannot be turned off. +EXTERN int p_force_off; ///< options that cannot be turned on. + +/// "indir" values for buffer-local options. +/// These need to be defined globally, so that the BV_COUNT can be used with +/// b_p_script_stx[]. +enum { + BV_AI = 0, + BV_AR, + BV_BH, + BV_BKC, + BV_BT, + BV_EFM, + BV_GP, + BV_MP, + BV_BIN, + BV_BL, + BV_BOMB, + BV_CHANNEL, + BV_CI, + BV_CIN, + BV_CINK, + BV_CINO, + BV_CINW, + BV_CINSD, + BV_CM, + BV_CMS, + BV_COM, + BV_CPT, + BV_DICT, + BV_TSR, + BV_CSL, + BV_CFU, + BV_DEF, + BV_INC, + BV_EOF, + BV_EOL, + BV_FIXEOL, + BV_EP, + BV_ET, + BV_FENC, + BV_FP, + BV_BEXPR, + BV_FEX, + BV_FF, + BV_FLP, + BV_FO, + BV_FT, + BV_IMI, + BV_IMS, + BV_INDE, + BV_INDK, + BV_INEX, + BV_INF, + BV_ISK, + BV_KMAP, + BV_KP, + BV_LISP, + BV_LOP, + BV_LW, + BV_MENC, + BV_MA, + BV_ML, + BV_MOD, + BV_MPS, + BV_NF, + BV_OFU, + BV_PATH, + BV_PI, + BV_QE, + BV_RO, + BV_SCBK, + BV_SI, + BV_SMC, + BV_SYN, + BV_SPC, + BV_SPF, + BV_SPL, + BV_SPO, + BV_STS, + BV_SUA, + BV_SW, + BV_SWF, + BV_TFU, + BV_TSRFU, + BV_TAGS, + BV_TC, + BV_TS, + BV_TW, + BV_TX, + BV_UDF, + BV_UL, + BV_WM, + BV_VSTS, + BV_VTS, + BV_COUNT, // must be the last one +}; + +/// "indir" values for window-local options. +/// These need to be defined globally, so that the WV_COUNT can be used in the +/// window structure. +enum { + WV_LIST = 0, + WV_ARAB, + WV_COCU, + WV_COLE, + WV_CRBIND, + WV_BRI, + WV_BRIOPT, + WV_DIFF, + WV_FDC, + WV_FEN, + WV_FDI, + WV_FDL, + WV_FDM, + WV_FML, + WV_FDN, + WV_FDE, + WV_FDT, + WV_FMR, + WV_LBR, + WV_NU, + WV_RNU, + WV_VE, + WV_NUW, + WV_PVW, + WV_RL, + WV_RLC, + WV_SCBIND, + WV_SCROLL, + WV_SMS, + WV_SISO, + WV_SO, + WV_SPELL, + WV_CUC, + WV_CUL, + WV_CULOPT, + WV_CC, + WV_SBR, + WV_STC, + WV_STL, + WV_WFH, + WV_WFW, + WV_WRAP, + WV_SCL, + WV_WINHL, + WV_LCS, + WV_FCS, + WV_WINBL, + WV_WBR, + WV_COUNT, // must be the last one +}; + +// Value for b_p_ul indicating the global value must be used. +#define NO_LOCAL_UNDOLEVEL (-123456) + +#define SB_MAX 100000 // Maximum 'scrollback' value. + +#define MAX_NUMBERWIDTH 20 // used for 'numberwidth' and 'statuscolumn' + +#define TABSTOP_MAX 9999 + +#endif // NVIM_OPTION_VARS_H diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index bb35848905..3ab40b48c8 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -37,6 +37,7 @@ #include "nvim/move.h" #include "nvim/option.h" #include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/os.h" #include "nvim/pos.h" diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index 10fe3cb114..b03509a313 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -25,7 +25,7 @@ #include "nvim/map.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/os.h" #include "nvim/path.h" #include "nvim/strings.h" diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 400284606f..77c4766419 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -35,7 +35,7 @@ #include "nvim/macros.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/fs_defs.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index d4ca31aa54..03418f4548 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -23,7 +23,7 @@ #include "nvim/macros.h" #include "nvim/main.h" #include "nvim/msgpack_rpc/channel.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/os/os_defs.h" #include "nvim/os/time.h" diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index be5c6be222..d885c8476f 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -31,7 +31,7 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/fs.h" #include "nvim/os/os_defs.h" #include "nvim/os/shell.h" diff --git a/src/nvim/path.c b/src/nvim/path.c index 36bbe3836d..21f0543756 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -26,6 +26,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" diff --git a/src/nvim/plines.c b/src/nvim/plines.c index 5334ab0091..97782b39bc 100644 --- a/src/nvim/plines.c +++ b/src/nvim/plines.c @@ -21,6 +21,7 @@ #include "nvim/memline.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/plines.h" #include "nvim/pos.h" #include "nvim/state.h" diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c index 2162251599..af4ffd7829 100644 --- a/src/nvim/popupmenu.c +++ b/src/nvim/popupmenu.c @@ -31,6 +31,7 @@ #include "nvim/message.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/popupmenu.h" #include "nvim/pos.h" #include "nvim/strings.h" diff --git a/src/nvim/profile.c b/src/nvim/profile.c index d8ba4741bc..3162a446c0 100644 --- a/src/nvim/profile.c +++ b/src/nvim/profile.c @@ -24,7 +24,6 @@ #include "nvim/keycodes.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" #include "nvim/os/os.h" #include "nvim/os/time.h" #include "nvim/pos.h" diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index fc2259f9ff..e6d5831dd3 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -47,6 +47,8 @@ #include "nvim/move.h" #include "nvim/normal.h" #include "nvim/option.h" +#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/fs_defs.h" #include "nvim/os/input.h" diff --git a/src/nvim/quickfix.h b/src/nvim/quickfix.h index 0da43e436c..70b013be9c 100644 --- a/src/nvim/quickfix.h +++ b/src/nvim/quickfix.h @@ -2,6 +2,7 @@ #define NVIM_QUICKFIX_H #include "nvim/ex_cmds_defs.h" +#include "nvim/option_defs.h" #include "nvim/types.h" // flags for skip_vimgrep_pat() diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 53612bcfc8..3f792cd8d5 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -31,7 +31,7 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/plines.h" #include "nvim/pos.h" diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c index 53896cb637..12cf08636f 100644 --- a/src/nvim/runtime.c +++ b/src/nvim/runtime.c @@ -40,6 +40,8 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/stdpaths_defs.h" diff --git a/src/nvim/runtime.h b/src/nvim/runtime.h index 23a9f468db..7308ef5f75 100644 --- a/src/nvim/runtime.h +++ b/src/nvim/runtime.h @@ -9,6 +9,7 @@ #include "nvim/ex_cmds_defs.h" #include "nvim/ex_eval_defs.h" #include "nvim/garray.h" +#include "nvim/option_defs.h" #include "nvim/pos.h" #include "nvim/types.h" diff --git a/src/nvim/search.c b/src/nvim/search.c index 87a591ea35..2d13ad3f0d 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -43,6 +43,7 @@ #include "nvim/move.h" #include "nvim/normal.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/time.h" diff --git a/src/nvim/shada.c b/src/nvim/shada.c index 09531cd7f2..14d35d9b59 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -42,6 +42,7 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/fileio.h" #include "nvim/os/fs_defs.h" #include "nvim/os/os.h" diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 1c7707995f..a97b9c6a0a 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -90,6 +90,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os_defs.h" diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index bdeabe4b95..f1df2e56f3 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -254,6 +254,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/time.h" diff --git a/src/nvim/spellsuggest.c b/src/nvim/spellsuggest.c index b028cf29ac..2ee93b4934 100644 --- a/src/nvim/spellsuggest.c +++ b/src/nvim/spellsuggest.c @@ -34,6 +34,7 @@ #include "nvim/message.h" #include "nvim/normal.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/fs.h" #include "nvim/os/input.h" #include "nvim/os/os_defs.h" diff --git a/src/nvim/state.c b/src/nvim/state.c index adb343a500..424fda2ede 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -20,6 +20,7 @@ #include "nvim/macros.h" #include "nvim/main.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/state.h" #include "nvim/strings.h" diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c index b062131287..1529b63812 100644 --- a/src/nvim/statusline.c +++ b/src/nvim/statusline.c @@ -33,6 +33,7 @@ #include "nvim/message.h" #include "nvim/normal.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/os.h" #include "nvim/path.h" diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 59e1a42bb0..9b238e6ff9 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -34,7 +34,7 @@ #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" #include "nvim/path.h" diff --git a/src/nvim/tag.c b/src/nvim/tag.c index d3778a343a..636d16d4e6 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -41,6 +41,8 @@ #include "nvim/message.h" #include "nvim/move.h" #include "nvim/option.h" +#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/input.h" #include "nvim/os/os.h" diff --git a/src/nvim/tag.h b/src/nvim/tag.h index e08145f727..90ef0384a1 100644 --- a/src/nvim/tag.h +++ b/src/nvim/tag.h @@ -2,6 +2,7 @@ #define NVIM_TAG_H #include "nvim/ex_cmds_defs.h" +#include "nvim/option_defs.h" #include "nvim/types.h" // Values for do_tag(). diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index de8eee0cab..169525da20 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -79,6 +79,7 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/pos.h" #include "nvim/state.h" diff --git a/src/nvim/textformat.c b/src/nvim/textformat.c index 674247bb60..0de62440f9 100644 --- a/src/nvim/textformat.c +++ b/src/nvim/textformat.c @@ -31,6 +31,7 @@ #include "nvim/normal.h" #include "nvim/ops.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/pos.h" #include "nvim/search.h" diff --git a/src/nvim/textobject.c b/src/nvim/textobject.c index a3b0f4b658..18a56c74ca 100644 --- a/src/nvim/textobject.c +++ b/src/nvim/textobject.c @@ -23,7 +23,7 @@ #include "nvim/memory.h" #include "nvim/move.h" #include "nvim/normal.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/pos.h" #include "nvim/search.h" #include "nvim/strings.h" diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index c8c27947eb..487f8b010e 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -17,7 +17,7 @@ #include "nvim/main.h" #include "nvim/map.h" #include "nvim/memory.h" -#include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/os.h" #include "nvim/tui/input.h" #include "nvim/tui/input_defs.h" diff --git a/src/nvim/ui.c b/src/nvim/ui.c index fc40d6fcfe..954d933d9c 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -30,6 +30,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/time.h" #include "nvim/strings.h" #include "nvim/ui.h" diff --git a/src/nvim/ui_compositor.c b/src/nvim/ui_compositor.c index b496ec28e4..0f26e269ae 100644 --- a/src/nvim/ui_compositor.c +++ b/src/nvim/ui_compositor.c @@ -25,7 +25,7 @@ #include "nvim/macros.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/time.h" #include "nvim/types.h" #include "nvim/ui.h" diff --git a/src/nvim/undo.c b/src/nvim/undo.c index b9b908c188..5396bfcda2 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -112,6 +112,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/option_vars.h" #include "nvim/os/fs_defs.h" #include "nvim/os/input.h" #include "nvim/os/os.h" diff --git a/src/nvim/usercmd.c b/src/nvim/usercmd.c index 8672aa88f7..131b1ce3ef 100644 --- a/src/nvim/usercmd.c +++ b/src/nvim/usercmd.c @@ -30,7 +30,7 @@ #include "nvim/memory.h" #include "nvim/menu.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/os/input.h" #include "nvim/runtime.h" #include "nvim/strings.h" diff --git a/src/nvim/version.c b/src/nvim/version.c index 35f8fe5373..20bbcb2f8a 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -31,7 +31,7 @@ #include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" -#include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/strings.h" #include "nvim/version.h" #include "nvim/vim.h" diff --git a/src/nvim/window.c b/src/nvim/window.c index eb4127325e..d73060494e 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -58,6 +58,7 @@ #include "nvim/normal.h" #include "nvim/option.h" #include "nvim/option_defs.h" +#include "nvim/option_vars.h" #include "nvim/optionstr.h" #include "nvim/os/os.h" #include "nvim/os/os_defs.h" diff --git a/test/unit/optionstr_spec.lua b/test/unit/optionstr_spec.lua index f8122f4fe0..2e7198a63a 100644 --- a/test/unit/optionstr_spec.lua +++ b/test/unit/optionstr_spec.lua @@ -4,10 +4,10 @@ local itp = helpers.gen_itp(it) local to_cstr = helpers.to_cstr local eq = helpers.eq -local option = helpers.cimport("./src/nvim/optionstr.h") +local optionstr = helpers.cimport("./src/nvim/optionstr.h") local check_ff_value = function(ff) - return option.check_ff_value(to_cstr(ff)) + return optionstr.check_ff_value(to_cstr(ff)) end describe('check_ff_value', function() diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua index 3a40e97755..8f45d2b0c7 100644 --- a/test/unit/os/fs_spec.lua +++ b/test/unit/os/fs_spec.lua @@ -22,10 +22,6 @@ local endswith = helpers.endswith local NODE_NORMAL = 0 local NODE_WRITABLE = 1 -cimport('./src/nvim/os/shell.h') -cimport('./src/nvim/option_defs.h') -cimport('./src/nvim/main.h') -cimport('./src/nvim/fileio.h') local fs = cimport('./src/nvim/os/os.h', './src/nvim/path.h') cppimport('sys/stat.h') cppimport('fcntl.h') diff --git a/test/unit/os/shell_spec.lua b/test/unit/os/shell_spec.lua index 29a2b78491..3fb1afed44 100644 --- a/test/unit/os/shell_spec.lua +++ b/test/unit/os/shell_spec.lua @@ -2,7 +2,7 @@ local helpers = require('test.unit.helpers')(after_each) local itp = helpers.gen_itp(it) local cimported = helpers.cimport( './src/nvim/os/shell.h', - './src/nvim/option_defs.h', + './src/nvim/option_vars.h', './src/nvim/main.h', './src/nvim/memory.h' ) diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua index f9ce1ff099..23f71cfe78 100644 --- a/test/unit/path_spec.lua +++ b/test/unit/path_spec.lua @@ -15,7 +15,7 @@ local mkdir = helpers.mkdir cimport('string.h') local cimp = cimport('./src/nvim/os/os.h', './src/nvim/path.h') -local options = cimport('./src/nvim/option_defs.h') +local options = cimport('./src/nvim/option_vars.h') local length = 0 local buffer = nil diff --git a/test/unit/undo_spec.lua b/test/unit/undo_spec.lua index 9261eca19d..ee4203b94c 100644 --- a/test/unit/undo_spec.lua +++ b/test/unit/undo_spec.lua @@ -11,10 +11,7 @@ local neq = helpers.neq local eq = helpers.eq local mkdir = helpers.mkdir -cimport('./src/nvim/ex_cmds_defs.h') -cimport('./src/nvim/buffer_defs.h') -local options = cimport('./src/nvim/option_defs.h') --- TODO: remove: local vim = cimport('./src/nvim/vim.h') +local options = cimport('./src/nvim/option_vars.h') local undo = cimport('./src/nvim/undo.h') local buffer = cimport('./src/nvim/buffer.h') |