refactor: format all C files under nvim/ #15977

* refactor: format all C files under nvim
* refactor: disable formatting for Vim-owned files:
    * src/nvim/indent_c.c
    * src/nvim/regexp.c
    * src/nvim/regexp_nfa.c
    * src/nvim/testdir/samples/memfile_test.c
This commit is contained in:
dundargoc 2021-10-12 16:56:52 +02:00 committed by GitHub
parent ee342d3cef
commit 40be47e0fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
111 changed files with 1331 additions and 1332 deletions

View File

@ -1166,8 +1166,7 @@ Boolean nvim_buf_del_mark(Buffer buffer, String name, Error *err)
/// @return true if the mark was set, else false. /// @return true if the mark was set, else false.
/// @see |nvim_buf_del_mark()| /// @see |nvim_buf_del_mark()|
/// @see |nvim_buf_get_mark()| /// @see |nvim_buf_get_mark()|
Boolean nvim_buf_set_mark(Buffer buffer, String name, Boolean nvim_buf_set_mark(Buffer buffer, String name, Integer line, Integer col, Error *err)
Integer line, Integer col, Error *err)
FUNC_API_SINCE(8) FUNC_API_SINCE(8)
{ {
bool res = false; bool res = false;
@ -1578,8 +1577,8 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer
if (opts->id.type == kObjectTypeInteger && opts->id.data.integer > 0) { if (opts->id.type == kObjectTypeInteger && opts->id.data.integer > 0) {
id = (uint64_t)opts->id.data.integer; id = (uint64_t)opts->id.data.integer;
} else if (HAS_KEY(opts->id)) { } else if (HAS_KEY(opts->id)) {
api_set_error(err, kErrorTypeValidation, "id is not a positive integer"); api_set_error(err, kErrorTypeValidation, "id is not a positive integer");
goto error; goto error;
} }
int line2 = -1; int line2 = -1;
@ -1655,10 +1654,10 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer
} }
#define OPTION_TO_BOOL(target, name, val) \ #define OPTION_TO_BOOL(target, name, val) \
target = api_object_to_bool(opts-> name, #name, val, err); \ target = api_object_to_bool(opts-> name, #name, val, err); \
if (ERROR_SET(err)) { \ if (ERROR_SET(err)) { \
goto error; \ goto error; \
} }
OPTION_TO_BOOL(decor.virt_text_hide, virt_text_hide, false); OPTION_TO_BOOL(decor.virt_text_hide, virt_text_hide, false);
OPTION_TO_BOOL(decor.hl_eol, hl_eol, false); OPTION_TO_BOOL(decor.hl_eol, hl_eol, false);

View File

@ -14,8 +14,8 @@
#include "nvim/api/tabpage.h" #include "nvim/api/tabpage.h"
#include "nvim/api/ui.h" #include "nvim/api/ui.h"
#include "nvim/api/vim.h" #include "nvim/api/vim.h"
#include "nvim/api/window.h"
#include "nvim/api/win_config.h" #include "nvim/api/win_config.h"
#include "nvim/api/window.h"
#include "nvim/log.h" #include "nvim/log.h"
#include "nvim/map.h" #include "nvim/map.h"
#include "nvim/msgpack_rpc/helpers.h" #include "nvim/msgpack_rpc/helpers.h"

View File

@ -4,9 +4,9 @@
#include <assert.h> #include <assert.h>
#include <inttypes.h> #include <inttypes.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stddef.h>
#include "nvim/api/private/defs.h" #include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h" #include "nvim/api/private/helpers.h"
@ -831,10 +831,10 @@ void modify_keymap(Buffer buffer, bool is_unmap, String mode, String lhs, String
MapArguments parsed_args = MAP_ARGUMENTS_INIT; MapArguments parsed_args = MAP_ARGUMENTS_INIT;
if (opts) { if (opts) {
#define KEY_TO_BOOL(name) \ #define KEY_TO_BOOL(name) \
parsed_args. name = api_object_to_bool(opts-> name, #name, false, err); \ parsed_args. name = api_object_to_bool(opts-> name, #name, false, err); \
if (ERROR_SET(err)) { \ if (ERROR_SET(err)) { \
goto fail_and_free; \ goto fail_and_free; \
} }
KEY_TO_BOOL(nowait); KEY_TO_BOOL(nowait);
KEY_TO_BOOL(noremap); KEY_TO_BOOL(noremap);

View File

@ -141,8 +141,8 @@ typedef struct {
} while (0) } while (0)
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "keysets.h.generated.h"
# include "api/private/helpers.h.generated.h" # include "api/private/helpers.h.generated.h"
# include "keysets.h.generated.h"
#endif #endif

View File

@ -2846,7 +2846,7 @@ Array nvim_get_mark(String name, Error *err)
bufnr = mark.fmark.fnum; bufnr = mark.fmark.fnum;
filename = (char *)buflist_nr2name(bufnr, true, true); filename = (char *)buflist_nr2name(bufnr, true, true);
allocated = true; allocated = true;
// Marks comes from shada // Marks comes from shada
} else { } else {
filename = (char *)mark.fname; filename = (char *)mark.fname;
bufnr = 0; bufnr = 0;

View File

@ -616,7 +616,7 @@ static bool parse_float_config(Dict(float_config) *config, FloatConfig *fconfig,
fconfig->style = kWinStyleUnused; fconfig->style = kWinStyleUnused;
} else if (striequal(config->style.data.string.data, "minimal")) { } else if (striequal(config->style.data.string.data, "minimal")) {
fconfig->style = kWinStyleMinimal; fconfig->style = kWinStyleMinimal;
} else { } else {
api_set_error(err, kErrorTypeValidation, "Invalid value of 'style' key"); api_set_error(err, kErrorTypeValidation, "Invalid value of 'style' key");
} }
} else if (HAS_KEY(config->style)) { } else if (HAS_KEY(config->style)) {

View File

@ -6,8 +6,8 @@
/// Whether c belongs to the range of Arabic characters that might be shaped. /// Whether c belongs to the range of Arabic characters that might be shaped.
static inline bool arabic_char(int c) static inline bool arabic_char(int c)
{ {
// return c >= a_HAMZA && c <= a_MINI_ALEF; // return c >= a_HAMZA && c <= a_MINI_ALEF;
return c >= 0x0621 && c <= 0x0670; return c >= 0x0621 && c <= 0x0670;
} }
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS

View File

@ -3,8 +3,8 @@
#include <stdbool.h> #include <stdbool.h>
#include "nvim/macros.h"
#include "nvim/func_attr.h" #include "nvim/func_attr.h"
#include "nvim/macros.h"
#include "nvim/os/os_defs.h" #include "nvim/os/os_defs.h"
// Definitions of various common control characters. // Definitions of various common control characters.

View File

@ -49,11 +49,11 @@
#define STATIC_ASSERT_PRAGMA_START #define STATIC_ASSERT_PRAGMA_START
#define STATIC_ASSERT_PRAGMA_END #define STATIC_ASSERT_PRAGMA_END
#define STATIC_ASSERT(cond, msg) \ #define STATIC_ASSERT(cond, msg) \
do { \ do { \
STATIC_ASSERT_PRAGMA_START \ STATIC_ASSERT_PRAGMA_START \
STATIC_ASSERT_STATEMENT(cond, msg); \ STATIC_ASSERT_STATEMENT(cond, msg); \
STATIC_ASSERT_PRAGMA_END \ STATIC_ASSERT_PRAGMA_END \
} while (0) } while (0)
// the easiest case, when the mode is C11 (generic compiler) or Clang // the easiest case, when the mode is C11 (generic compiler) or Clang
// advertises explicit support for c_static_assert, meaning it won't warn. // advertises explicit support for c_static_assert, meaning it won't warn.
@ -68,19 +68,19 @@
# undef STATIC_ASSERT_PRAGMA_START # undef STATIC_ASSERT_PRAGMA_START
#if __GNUC__ >= 6 # if __GNUC__ >= 6
# define STATIC_ASSERT_PRAGMA_START \ # define STATIC_ASSERT_PRAGMA_START \
_Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic push")\
_Pragma("GCC diagnostic ignored \"-Wpedantic\"") _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
#else # else
# define STATIC_ASSERT_PRAGMA_START \ # define STATIC_ASSERT_PRAGMA_START \
_Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic push")\
_Pragma("GCC diagnostic ignored \"-pedantic\"") _Pragma("GCC diagnostic ignored \"-pedantic\"")
#endif # endif
# undef STATIC_ASSERT_PRAGMA_END # undef STATIC_ASSERT_PRAGMA_END
# define STATIC_ASSERT_PRAGMA_END \ # define STATIC_ASSERT_PRAGMA_END \
_Pragma("GCC diagnostic pop") _Pragma("GCC diagnostic pop")
// the same goes for clang in C99 mode, but we suppress a different warning // the same goes for clang in C99 mode, but we suppress a different warning
#elif defined(__clang__) && __has_extension(c_static_assert) #elif defined(__clang__) && __has_extension(c_static_assert)
@ -89,12 +89,12 @@
# undef STATIC_ASSERT_PRAGMA_START # undef STATIC_ASSERT_PRAGMA_START
# define STATIC_ASSERT_PRAGMA_START \ # define STATIC_ASSERT_PRAGMA_START \
_Pragma("clang diagnostic push") \ _Pragma("clang diagnostic push")\
_Pragma("clang diagnostic ignored \"-Wc11-extensions\"") _Pragma("clang diagnostic ignored \"-Wc11-extensions\"")
# undef STATIC_ASSERT_PRAGMA_END # undef STATIC_ASSERT_PRAGMA_END
# define STATIC_ASSERT_PRAGMA_END \ # define STATIC_ASSERT_PRAGMA_END \
_Pragma("clang diagnostic pop") _Pragma("clang diagnostic pop")
// TODO(aktau): verify that this works, don't have MSVC on hand. // TODO(aktau): verify that this works, don't have MSVC on hand.
#elif _MSC_VER >= 1600 #elif _MSC_VER >= 1600
@ -113,14 +113,14 @@
// These can't be used after statements in c89. // These can't be used after statements in c89.
#ifdef __COUNTER__ #ifdef __COUNTER__
# define STATIC_ASSERT_EXPR(e, m) \ # define STATIC_ASSERT_EXPR(e, m) \
((enum { ASSERT_CONCAT(static_assert_, __COUNTER__) = 1/(!!(e)) }) 0) ((enum { ASSERT_CONCAT(static_assert_, __COUNTER__) = 1/(!!(e)) }) 0)
#else #else
// This can't be used twice on the same line so ensure if using in headers // This can't be used twice on the same line so ensure if using in headers
// that the headers are not included twice (by wrapping in #ifndef...#endif) // that the headers are not included twice (by wrapping in #ifndef...#endif)
// Note it doesn't cause an issue when used on same line of separate modules // Note it doesn't cause an issue when used on same line of separate modules
// compiled with gcc -combine -fwhole-program. // compiled with gcc -combine -fwhole-program.
# define STATIC_ASSERT_EXPR(e, m) \ # define STATIC_ASSERT_EXPR(e, m) \
((enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(e)) }) 0) ((enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(e)) }) 0)
#endif #endif
/// @def STRICT_ADD /// @def STRICT_ADD

View File

@ -17,22 +17,22 @@ typedef struct {
} aco_save_T; } aco_save_T;
typedef struct AutoCmd { typedef struct AutoCmd {
char_u *cmd; // Command to be executed (NULL when char_u *cmd; // Command to be executed (NULL when
// command has been removed) // command has been removed)
bool once; // "One shot": removed after execution bool once; // "One shot": removed after execution
bool nested; // If autocommands nest here bool nested; // If autocommands nest here
bool last; // last command in list bool last; // last command in list
sctx_T script_ctx; // script context where defined sctx_T script_ctx; // script context where defined
struct AutoCmd *next; // Next AutoCmd in list struct AutoCmd *next; // Next AutoCmd in list
} AutoCmd; } AutoCmd;
typedef struct AutoPat { typedef struct AutoPat {
struct AutoPat *next; // next AutoPat in AutoPat list; MUST struct AutoPat *next; // next AutoPat in AutoPat list; MUST
// be the first entry // be the first entry
char_u *pat; // pattern as typed (NULL when pattern char_u *pat; // pattern as typed (NULL when pattern
// has been removed) // has been removed)
regprog_T *reg_prog; // compiled regprog for pattern regprog_T *reg_prog; // compiled regprog for pattern
AutoCmd *cmds; // list of commands to do AutoCmd *cmds; // list of commands to do
int group; // group ID int group; // group ID
int patlen; // strlen() of pat int patlen; // strlen() of pat
int buflocal_nr; // !=0 for buffer-local AutoPat int buflocal_nr; // !=0 for buffer-local AutoPat
@ -48,16 +48,16 @@ typedef struct AutoPat {
/// Struct used to keep status while executing autocommands for an event. /// Struct used to keep status while executing autocommands for an event.
/// ///
typedef struct AutoPatCmd { typedef struct AutoPatCmd {
AutoPat *curpat; // next AutoPat to examine AutoPat *curpat; // next AutoPat to examine
AutoCmd *nextcmd; // next AutoCmd to execute AutoCmd *nextcmd; // next AutoCmd to execute
int group; // group being used int group; // group being used
char_u *fname; // fname to match with char_u *fname; // fname to match with
char_u *sfname; // sfname to match with char_u *sfname; // sfname to match with
char_u *tail; // tail of fname char_u *tail; // tail of fname
event_T event; // current event event_T event; // current event
int arg_bufnr; // initially equal to <abuf>, set to zero when int arg_bufnr; // initially equal to <abuf>, set to zero when
// buf is deleted // buf is deleted
struct AutoPatCmd *next; // chain of active apc-s for auto-invalidation struct AutoPatCmd *next; // chain of active apc-s for auto-invalidation
} AutoPatCmd; } AutoPatCmd;

View File

@ -1,21 +1,21 @@
#ifndef NVIM_BUFFER_H #ifndef NVIM_BUFFER_H
#define NVIM_BUFFER_H #define NVIM_BUFFER_H
#include "nvim/vim.h"
#include "nvim/window.h"
#include "nvim/pos.h" // for linenr_T
#include "nvim/ex_cmds_defs.h" // for exarg_T
#include "nvim/screen.h" // for StlClickRecord
#include "nvim/func_attr.h"
#include "nvim/eval.h" #include "nvim/eval.h"
#include "nvim/ex_cmds_defs.h" // for exarg_T
#include "nvim/func_attr.h"
#include "nvim/macros.h" #include "nvim/macros.h"
#include "nvim/memline.h" #include "nvim/memline.h"
#include "nvim/pos.h" // for linenr_T
#include "nvim/screen.h" // for StlClickRecord
#include "nvim/vim.h"
#include "nvim/window.h"
// Values for buflist_getfile() // Values for buflist_getfile()
enum getf_values { enum getf_values {
GETF_SETMARK = 0x01, // set pcmark before jumping GETF_SETMARK = 0x01, // set pcmark before jumping
GETF_ALT = 0x02, // jumping to alternate file (not buf num) GETF_ALT = 0x02, // jumping to alternate file (not buf num)
GETF_SWITCH = 0x04, // respect 'switchbuf' settings when jumping GETF_SWITCH = 0x04, // respect 'switchbuf' settings when jumping
}; };
// Return values of getfile() // Return values of getfile()
@ -41,26 +41,26 @@ enum bln_values {
// Values for action argument for do_buffer() // Values for action argument for do_buffer()
enum dobuf_action_values { enum dobuf_action_values {
DOBUF_GOTO = 0, // go to specified buffer DOBUF_GOTO = 0, // go to specified buffer
DOBUF_SPLIT = 1, // split window and go to specified buffer DOBUF_SPLIT = 1, // split window and go to specified buffer
DOBUF_UNLOAD = 2, // unload specified buffer(s) DOBUF_UNLOAD = 2, // unload specified buffer(s)
DOBUF_DEL = 3, // delete specified buffer(s) from buflist DOBUF_DEL = 3, // delete specified buffer(s) from buflist
DOBUF_WIPE = 4, // delete specified buffer(s) really DOBUF_WIPE = 4, // delete specified buffer(s) really
}; };
// Values for start argument for do_buffer() // Values for start argument for do_buffer()
enum dobuf_start_values { enum dobuf_start_values {
DOBUF_CURRENT = 0, // "count" buffer from current buffer DOBUF_CURRENT = 0, // "count" buffer from current buffer
DOBUF_FIRST = 1, // "count" buffer from first buffer DOBUF_FIRST = 1, // "count" buffer from first buffer
DOBUF_LAST = 2, // "count" buffer from last buffer DOBUF_LAST = 2, // "count" buffer from last buffer
DOBUF_MOD = 3, // "count" mod. buffer from current buffer DOBUF_MOD = 3, // "count" mod. buffer from current buffer
}; };
// flags for buf_freeall() // flags for buf_freeall()
enum bfa_values { enum bfa_values {
BFA_DEL = 1, // buffer is going to be deleted BFA_DEL = 1, // buffer is going to be deleted
BFA_WIPE = 2, // buffer is going to be wiped out BFA_WIPE = 2, // buffer is going to be wiped out
BFA_KEEP_UNDO = 4, // do not free undo information BFA_KEEP_UNDO = 4, // do not free undo information
}; };
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
@ -75,14 +75,12 @@ static inline void buf_set_changedtick(buf_T *const buf,
/// ///
/// @param[out] buf Buffer to set changedtick in. /// @param[out] buf Buffer to set changedtick in.
/// @param[in] changedtick New value. /// @param[in] changedtick New value.
static inline void buf_set_changedtick(buf_T *const buf, static inline void buf_set_changedtick(buf_T *const buf, const varnumber_T changedtick)
const varnumber_T changedtick)
{ {
typval_T old_val = buf->changedtick_di.di_tv; typval_T old_val = buf->changedtick_di.di_tv;
#ifndef NDEBUG #ifndef NDEBUG
dictitem_T *const changedtick_di = tv_dict_find( dictitem_T *const changedtick_di = tv_dict_find(buf->b_vars, S_LEN("changedtick"));
buf->b_vars, S_LEN("changedtick"));
assert(changedtick_di != NULL); assert(changedtick_di != NULL);
assert(changedtick_di->di_tv.v_type == VAR_NUMBER); assert(changedtick_di->di_tv.v_type == VAR_NUMBER);
assert(changedtick_di->di_tv.v_lock == VAR_FIXED); assert(changedtick_di->di_tv.v_lock == VAR_FIXED);
@ -132,7 +130,7 @@ static inline void buf_inc_changedtick(buf_T *const buf)
static inline bool buf_is_empty(buf_T *buf) static inline bool buf_is_empty(buf_T *buf)
{ {
return buf->b_ml.ml_line_count == 1 return buf->b_ml.ml_line_count == 1
&& *ml_get_buf(buf, (linenr_T)1, false) == '\0'; && *ml_get_buf(buf, (linenr_T)1, false) == '\0';
} }
#endif // NVIM_BUFFER_H #endif // NVIM_BUFFER_H

View File

@ -6,14 +6,14 @@
// for FILE // for FILE
#include <stdio.h> #include <stdio.h>
typedef struct file_buffer buf_T; // Forward declaration typedef struct file_buffer buf_T; // Forward declaration
// Reference to a buffer that stores the value of buf_free_count. // Reference to a buffer that stores the value of buf_free_count.
// bufref_valid() only needs to check "buf" when the count differs. // bufref_valid() only needs to check "buf" when the count differs.
typedef struct { typedef struct {
buf_T *br_buf; buf_T *br_buf;
int br_fnum; int br_fnum;
int br_buf_free_count; int br_buf_free_count;
} bufref_T; } bufref_T;
// for garray_T // for garray_T
@ -111,16 +111,15 @@ typedef uint16_t disptick_T; // display tick type
// for synstate_T (needs reg_extmatch_T, win_T, buf_T) // for synstate_T (needs reg_extmatch_T, win_T, buf_T)
#include "nvim/syntax_defs.h" #include "nvim/syntax_defs.h"
// for sign_entry_T // for sign_entry_T
#include "nvim/sign_defs.h"
#include "nvim/os/fs_defs.h" // for FileID #include "nvim/os/fs_defs.h" // for FileID
#include "nvim/sign_defs.h"
#include "nvim/terminal.h" // for Terminal #include "nvim/terminal.h" // for Terminal
/* /*
* The taggy struct is used to store the information about a :tag command. * The taggy struct is used to store the information about a :tag command.
*/ */
typedef struct taggy { typedef struct taggy {
char_u *tagname; // tag name char_u *tagname; // tag name
fmark_T fmark; // cursor position BEFORE ":tag" fmark_T fmark; // cursor position BEFORE ":tag"
int cur_match; // match number int cur_match; // match number
int cur_fnum; // buffer number used for cur_match int cur_fnum; // buffer number used for cur_match
@ -161,45 +160,45 @@ typedef struct
*/ */
typedef struct { typedef struct {
int wo_arab; int wo_arab;
# define w_p_arab w_onebuf_opt.wo_arab // 'arabic' #define w_p_arab w_onebuf_opt.wo_arab // 'arabic'
int wo_bri; int wo_bri;
# define w_p_bri w_onebuf_opt.wo_bri // 'breakindent' #define w_p_bri w_onebuf_opt.wo_bri // 'breakindent'
char_u *wo_briopt; char_u *wo_briopt;
# define w_p_briopt w_onebuf_opt.wo_briopt // 'breakindentopt' #define w_p_briopt w_onebuf_opt.wo_briopt // 'breakindentopt'
int wo_diff; int wo_diff;
# define w_p_diff w_onebuf_opt.wo_diff // 'diff' #define w_p_diff w_onebuf_opt.wo_diff // 'diff'
char_u *wo_fdc; char_u *wo_fdc;
# define w_p_fdc w_onebuf_opt.wo_fdc // 'foldcolumn' #define w_p_fdc w_onebuf_opt.wo_fdc // 'foldcolumn'
char_u *wo_fdc_save; char_u *wo_fdc_save;
# define w_p_fdc_save w_onebuf_opt.wo_fdc_save // 'fdc' saved for diff mode #define w_p_fdc_save w_onebuf_opt.wo_fdc_save // 'fdc' saved for diff mode
int wo_fen; int wo_fen;
# define w_p_fen w_onebuf_opt.wo_fen // 'foldenable' #define w_p_fen w_onebuf_opt.wo_fen // 'foldenable'
int wo_fen_save; int wo_fen_save;
// 'foldenable' saved for diff mode // 'foldenable' saved for diff mode
# define w_p_fen_save w_onebuf_opt.wo_fen_save #define w_p_fen_save w_onebuf_opt.wo_fen_save
char_u *wo_fdi; char_u *wo_fdi;
# define w_p_fdi w_onebuf_opt.wo_fdi // 'foldignore' #define w_p_fdi w_onebuf_opt.wo_fdi // 'foldignore'
long wo_fdl; long wo_fdl;
# define w_p_fdl w_onebuf_opt.wo_fdl // 'foldlevel' #define w_p_fdl w_onebuf_opt.wo_fdl // 'foldlevel'
int wo_fdl_save; int wo_fdl_save;
// 'foldlevel' state saved for diff mode // 'foldlevel' state saved for diff mode
# define w_p_fdl_save w_onebuf_opt.wo_fdl_save #define w_p_fdl_save w_onebuf_opt.wo_fdl_save
char_u *wo_fdm; char_u *wo_fdm;
# define w_p_fdm w_onebuf_opt.wo_fdm // 'foldmethod' #define w_p_fdm w_onebuf_opt.wo_fdm // 'foldmethod'
char_u *wo_fdm_save; char_u *wo_fdm_save;
# define w_p_fdm_save w_onebuf_opt.wo_fdm_save // 'fdm' saved for diff mode #define w_p_fdm_save w_onebuf_opt.wo_fdm_save // 'fdm' saved for diff mode
long wo_fml; long wo_fml;
# define w_p_fml w_onebuf_opt.wo_fml // 'foldminlines' #define w_p_fml w_onebuf_opt.wo_fml // 'foldminlines'
long wo_fdn; long wo_fdn;
# define w_p_fdn w_onebuf_opt.wo_fdn // 'foldnestmax' #define w_p_fdn w_onebuf_opt.wo_fdn // 'foldnestmax'
char_u *wo_fde; char_u *wo_fde;
# define w_p_fde w_onebuf_opt.wo_fde // 'foldexpr' #define w_p_fde w_onebuf_opt.wo_fde // 'foldexpr'
char_u *wo_fdt; char_u *wo_fdt;
# define w_p_fdt w_onebuf_opt.wo_fdt // 'foldtext' #define w_p_fdt w_onebuf_opt.wo_fdt // 'foldtext'
char_u *wo_fmr; char_u *wo_fmr;
# define w_p_fmr w_onebuf_opt.wo_fmr // 'foldmarker' #define w_p_fmr w_onebuf_opt.wo_fmr // 'foldmarker'
int wo_lbr; int wo_lbr;
# define w_p_lbr w_onebuf_opt.wo_lbr // 'linebreak' #define w_p_lbr w_onebuf_opt.wo_lbr // 'linebreak'
int wo_list; int wo_list;
#define w_p_list w_onebuf_opt.wo_list // 'list' #define w_p_list w_onebuf_opt.wo_list // 'list'
int wo_nu; int wo_nu;
@ -207,64 +206,64 @@ typedef struct {
int wo_rnu; int wo_rnu;
#define w_p_rnu w_onebuf_opt.wo_rnu // 'relativenumber' #define w_p_rnu w_onebuf_opt.wo_rnu // 'relativenumber'
long wo_nuw; long wo_nuw;
# define w_p_nuw w_onebuf_opt.wo_nuw // 'numberwidth' #define w_p_nuw w_onebuf_opt.wo_nuw // 'numberwidth'
int wo_wfh; int wo_wfh;
# define w_p_wfh w_onebuf_opt.wo_wfh // 'winfixheight' #define w_p_wfh w_onebuf_opt.wo_wfh // 'winfixheight'
int wo_wfw; int wo_wfw;
# define w_p_wfw w_onebuf_opt.wo_wfw // 'winfixwidth' #define w_p_wfw w_onebuf_opt.wo_wfw // 'winfixwidth'
int wo_pvw; int wo_pvw;
# define w_p_pvw w_onebuf_opt.wo_pvw // 'previewwindow' #define w_p_pvw w_onebuf_opt.wo_pvw // 'previewwindow'
int wo_rl; int wo_rl;
# define w_p_rl w_onebuf_opt.wo_rl // 'rightleft' #define w_p_rl w_onebuf_opt.wo_rl // 'rightleft'
char_u *wo_rlc; char_u *wo_rlc;
# define w_p_rlc w_onebuf_opt.wo_rlc // 'rightleftcmd' #define w_p_rlc w_onebuf_opt.wo_rlc // 'rightleftcmd'
long wo_scr; long wo_scr;
#define w_p_scr w_onebuf_opt.wo_scr // 'scroll' #define w_p_scr w_onebuf_opt.wo_scr // 'scroll'
int wo_spell; int wo_spell;
# define w_p_spell w_onebuf_opt.wo_spell // 'spell' #define w_p_spell w_onebuf_opt.wo_spell // 'spell'
int wo_cuc; int wo_cuc;
# define w_p_cuc w_onebuf_opt.wo_cuc // 'cursorcolumn' #define w_p_cuc w_onebuf_opt.wo_cuc // 'cursorcolumn'
int wo_cul; int wo_cul;
# define w_p_cul w_onebuf_opt.wo_cul // 'cursorline' #define w_p_cul w_onebuf_opt.wo_cul // 'cursorline'
char_u *wo_culopt; char_u *wo_culopt;
# define w_p_culopt w_onebuf_opt.wo_culopt // 'cursorlineopt' #define w_p_culopt w_onebuf_opt.wo_culopt // 'cursorlineopt'
char_u *wo_cc; char_u *wo_cc;
# define w_p_cc w_onebuf_opt.wo_cc // 'colorcolumn' #define w_p_cc w_onebuf_opt.wo_cc // 'colorcolumn'
char_u *wo_sbr; char_u *wo_sbr;
# define w_p_sbr w_onebuf_opt.wo_sbr // 'showbreak' #define w_p_sbr w_onebuf_opt.wo_sbr // 'showbreak'
char_u *wo_stl; char_u *wo_stl;
#define w_p_stl w_onebuf_opt.wo_stl // 'statusline' #define w_p_stl w_onebuf_opt.wo_stl // 'statusline'
int wo_scb; int wo_scb;
# define w_p_scb w_onebuf_opt.wo_scb // 'scrollbind' #define w_p_scb w_onebuf_opt.wo_scb // 'scrollbind'
int wo_diff_saved; // options were saved for starting diff mode int wo_diff_saved; // options were saved for starting diff mode
# define w_p_diff_saved w_onebuf_opt.wo_diff_saved #define w_p_diff_saved w_onebuf_opt.wo_diff_saved
int wo_scb_save; // 'scrollbind' saved for diff mode int wo_scb_save; // 'scrollbind' saved for diff mode
# define w_p_scb_save w_onebuf_opt.wo_scb_save #define w_p_scb_save w_onebuf_opt.wo_scb_save
int wo_wrap; int wo_wrap;
#define w_p_wrap w_onebuf_opt.wo_wrap // 'wrap' #define w_p_wrap w_onebuf_opt.wo_wrap // 'wrap'
int wo_wrap_save; // 'wrap' state saved for diff mode int wo_wrap_save; // 'wrap' state saved for diff mode
# define w_p_wrap_save w_onebuf_opt.wo_wrap_save #define w_p_wrap_save w_onebuf_opt.wo_wrap_save
char_u *wo_cocu; // 'concealcursor' char_u *wo_cocu; // 'concealcursor'
# define w_p_cocu w_onebuf_opt.wo_cocu #define w_p_cocu w_onebuf_opt.wo_cocu
long wo_cole; // 'conceallevel' long wo_cole; // 'conceallevel'
# define w_p_cole w_onebuf_opt.wo_cole #define w_p_cole w_onebuf_opt.wo_cole
int wo_crb; int wo_crb;
# define w_p_crb w_onebuf_opt.wo_crb // 'cursorbind' #define w_p_crb w_onebuf_opt.wo_crb // 'cursorbind'
int wo_crb_save; // 'cursorbind' state saved for diff mode int wo_crb_save; // 'cursorbind' state saved for diff mode
# define w_p_crb_save w_onebuf_opt.wo_crb_save #define w_p_crb_save w_onebuf_opt.wo_crb_save
char_u *wo_scl; char_u *wo_scl;
# define w_p_scl w_onebuf_opt.wo_scl // 'signcolumn' #define w_p_scl w_onebuf_opt.wo_scl // 'signcolumn'
char_u *wo_winhl; char_u *wo_winhl;
# define w_p_winhl w_onebuf_opt.wo_winhl // 'winhighlight' #define w_p_winhl w_onebuf_opt.wo_winhl // 'winhighlight'
char_u *wo_fcs; char_u *wo_fcs;
# define w_p_fcs w_onebuf_opt.wo_fcs // 'fillchars' #define w_p_fcs w_onebuf_opt.wo_fcs // 'fillchars'
char_u *wo_lcs; char_u *wo_lcs;
# define w_p_lcs w_onebuf_opt.wo_lcs // 'listchars' #define w_p_lcs w_onebuf_opt.wo_lcs // 'listchars'
long wo_winbl; long wo_winbl;
# define w_p_winbl w_onebuf_opt.wo_winbl // 'winblend' #define w_p_winbl w_onebuf_opt.wo_winbl // 'winblend'
LastSet wo_script_ctx[WV_COUNT]; // SCTXs for window-local options LastSet wo_script_ctx[WV_COUNT]; // SCTXs for window-local options
# define w_p_script_ctx w_onebuf_opt.wo_script_ctx #define w_p_script_ctx w_onebuf_opt.wo_script_ctx
} winopt_T; } winopt_T;
/* /*
@ -278,9 +277,9 @@ typedef struct {
* most-recently-used order. * most-recently-used order.
*/ */
struct wininfo_S { struct wininfo_S {
wininfo_T *wi_next; // next entry or NULL for last entry wininfo_T *wi_next; // next entry or NULL for last entry
wininfo_T *wi_prev; // previous entry or NULL for first entry wininfo_T *wi_prev; // previous entry or NULL for first entry
win_T *wi_win; // pointer to window that did set wi_fpos win_T *wi_win; // pointer to window that did set wi_fpos
pos_T wi_fpos; // last cursor position in the file pos_T wi_fpos; // last cursor position in the file
bool wi_optset; // true when wi_opt has useful values bool wi_optset; // true when wi_opt has useful values
winopt_T wi_opt; // local window options winopt_T wi_opt; // local window options
@ -306,11 +305,11 @@ typedef struct arglist {
// //
// TODO(Felipe): move aentry_T to another header // TODO(Felipe): move aentry_T to another header
typedef struct argentry { typedef struct argentry {
char_u *ae_fname; // file name as specified char_u *ae_fname; // file name as specified
int ae_fnum; // buffer number with expanded file name int ae_fnum; // buffer number with expanded file name
} aentry_T; } aentry_T;
# define ALIST(win) (win)->w_alist #define ALIST(win) (win)->w_alist
#define GARGLIST ((aentry_T *)global_alist.al_ga.ga_data) #define GARGLIST ((aentry_T *)global_alist.al_ga.ga_data)
#define ARGLIST ((aentry_T *)ALIST(curwin)->al_ga.ga_data) #define ARGLIST ((aentry_T *)ALIST(curwin)->al_ga.ga_data)
#define WARGLIST(wp) ((aentry_T *)ALIST(wp)->al_ga.ga_data) #define WARGLIST(wp) ((aentry_T *)ALIST(wp)->al_ga.ga_data)
@ -323,8 +322,8 @@ typedef struct argentry {
* Used for the typeahead buffer: typebuf. * Used for the typeahead buffer: typebuf.
*/ */
typedef struct { typedef struct {
char_u *tb_buf; // buffer for typed characters char_u *tb_buf; // buffer for typed characters
char_u *tb_noremap; // mapping flags for characters in tb_buf[] char_u *tb_noremap; // mapping flags for characters in tb_buf[]
int tb_buflen; // size of tb_buf[] int tb_buflen; // size of tb_buf[]
int tb_off; // current position in tb_buf[] int tb_off; // current position in tb_buf[]
int tb_len; // number of valid bytes in tb_buf[] int tb_len; // number of valid bytes in tb_buf[]
@ -350,10 +349,10 @@ typedef struct {
*/ */
typedef struct mapblock mapblock_T; typedef struct mapblock mapblock_T;
struct mapblock { struct mapblock {
mapblock_T *m_next; // next mapblock in list mapblock_T *m_next; // next mapblock in list
char_u *m_keys; // mapped from, lhs char_u *m_keys; // mapped from, lhs
char_u *m_str; // mapped to, rhs char_u *m_str; // mapped to, rhs
char_u *m_orig_str; // rhs as entered by the user char_u *m_orig_str; // rhs as entered by the user
int m_keylen; // strlen(m_keys) int m_keylen; // strlen(m_keys)
int m_mode; // valid mode int m_mode; // valid mode
int m_noremap; // if non-zero no re-mapping for m_str int m_noremap; // if non-zero no re-mapping for m_str
@ -366,7 +365,7 @@ struct mapblock {
/// Used for highlighting in the status line. /// Used for highlighting in the status line.
typedef struct stl_hlrec stl_hlrec_t; typedef struct stl_hlrec stl_hlrec_t;
struct stl_hlrec { struct stl_hlrec {
char_u *start; char_u *start;
int userhl; // 0: no HL, 1-9: User HL, < 0 for syn ID int userhl; // 0: no HL, 1-9: User HL, < 0 for syn ID
}; };
@ -403,7 +402,7 @@ struct stl_item {
#define SYNFLD_MINIMUM 1 // use lowest local minimum level on line #define SYNFLD_MINIMUM 1 // use lowest local minimum level on line
// avoid #ifdefs for when b_spell is not available // avoid #ifdefs for when b_spell is not available
# define B_SPELL(buf) ((buf)->b_spell) #define B_SPELL(buf) ((buf)->b_spell)
typedef struct qf_info_S qf_info_T; typedef struct qf_info_S qf_info_T;
@ -440,8 +439,8 @@ typedef struct {
long b_syn_sync_minlines; // minimal sync lines offset long b_syn_sync_minlines; // minimal sync lines offset
long b_syn_sync_maxlines; // maximal sync lines offset long b_syn_sync_maxlines; // maximal sync lines offset
long b_syn_sync_linebreaks; // offset for multi-line pattern long b_syn_sync_linebreaks; // offset for multi-line pattern
char_u *b_syn_linecont_pat; // line continuation pattern char_u *b_syn_linecont_pat; // line continuation pattern
regprog_T *b_syn_linecont_prog; // line continuation program regprog_T *b_syn_linecont_prog; // line continuation program
syn_time_T b_syn_linecont_time; syn_time_T b_syn_linecont_time;
int b_syn_linecont_ic; // ignore-case flag for above int b_syn_linecont_ic; // ignore-case flag for above
int b_syn_topgrp; // for ":syntax include" int b_syn_topgrp; // for ":syntax include"
@ -460,10 +459,10 @@ typedef struct {
// b_sst_freecount number of free entries in b_sst_array[] // b_sst_freecount number of free entries in b_sst_array[]
// b_sst_check_lnum entries after this lnum need to be checked for // b_sst_check_lnum entries after this lnum need to be checked for
// validity (MAXLNUM means no check needed) // validity (MAXLNUM means no check needed)
synstate_T *b_sst_array; synstate_T *b_sst_array;
int b_sst_len; int b_sst_len;
synstate_T *b_sst_first; synstate_T *b_sst_first;
synstate_T *b_sst_firstfree; synstate_T *b_sst_firstfree;
int b_sst_freecount; int b_sst_freecount;
linenr_T b_sst_check_lnum; linenr_T b_sst_check_lnum;
disptick_T b_sst_lasttick; // last display tick disptick_T b_sst_lasttick; // last display tick
@ -471,12 +470,12 @@ typedef struct {
// for spell checking // for spell checking
garray_T b_langp; // list of pointers to slang_T, see spell.c garray_T b_langp; // list of pointers to slang_T, see spell.c
bool b_spell_ismw[256]; // flags: is midword char bool b_spell_ismw[256]; // flags: is midword char
char_u *b_spell_ismw_mb; // multi-byte midword chars char_u *b_spell_ismw_mb; // multi-byte midword chars
char_u *b_p_spc; // 'spellcapcheck' char_u *b_p_spc; // 'spellcapcheck'
regprog_T *b_cap_prog; // program for 'spellcapcheck' regprog_T *b_cap_prog; // program for 'spellcapcheck'
char_u *b_p_spf; // 'spellfile' char_u *b_p_spf; // 'spellfile'
char_u *b_p_spl; // 'spelllang' char_u *b_p_spl; // 'spelllang'
char_u *b_p_spo; // 'spelloptions' char_u *b_p_spo; // 'spelloptions'
int b_cjk; // all CJK letters as OK int b_cjk; // all CJK letters as OK
char_u b_syn_chartab[32]; // syntax iskeyword option char_u b_syn_chartab[32]; // syntax iskeyword option
char_u *b_syn_isk; // iskeyword option char_u *b_syn_isk; // iskeyword option
@ -521,8 +520,8 @@ struct file_buffer {
memline_T b_ml; // associated memline (also contains line count memline_T b_ml; // associated memline (also contains line count
buf_T *b_next; // links in list of buffers buf_T *b_next; // links in list of buffers
buf_T *b_prev; buf_T *b_prev;
int b_nwindows; // nr of windows open on this buffer int b_nwindows; // nr of windows open on this buffer
@ -538,11 +537,11 @@ struct file_buffer {
// b_fname is the same as b_sfname, unless ":cd" has been done, // b_fname is the same as b_sfname, unless ":cd" has been done,
// then it is the same as b_ffname (NULL for no name). // then it is the same as b_ffname (NULL for no name).
// //
char_u *b_ffname; // full path file name, allocated char_u *b_ffname; // full path file name, allocated
char_u *b_sfname; // short file name, allocated, may be equal to char_u *b_sfname; // short file name, allocated, may be equal to
// b_ffname // b_ffname
char_u *b_fname; // current file name, points to b_ffname or char_u *b_fname; // current file name, points to b_ffname or
// b_sfname // b_sfname
bool file_id_valid; bool file_id_valid;
FileID file_id; FileID file_id;
@ -577,7 +576,7 @@ struct file_buffer {
// change // change
long b_mod_xlines; // number of extra buffer lines inserted; long b_mod_xlines; // number of extra buffer lines inserted;
// negative when lines were deleted // negative when lines were deleted
wininfo_T *b_wininfo; // list of last used info for each window wininfo_T *b_wininfo; // list of last used info for each window
int b_mod_tick_syn; // last display tick syntax was updated int b_mod_tick_syn; // last display tick syntax was updated
int b_mod_tick_decor; // last display tick decoration providers int b_mod_tick_decor; // last display tick decoration providers
// where invoked // where invoked
@ -614,10 +613,10 @@ struct file_buffer {
uint64_t b_chartab[4]; uint64_t b_chartab[4];
// Table used for mappings local to a buffer. // Table used for mappings local to a buffer.
mapblock_T *(b_maphash[MAX_MAPHASH]); mapblock_T *(b_maphash[MAX_MAPHASH]);
// First abbreviation local to a buffer. // First abbreviation local to a buffer.
mapblock_T *b_first_abbr; mapblock_T *b_first_abbr;
// User commands local to the buffer. // User commands local to the buffer.
garray_T b_ucmds; garray_T b_ucmds;
/* /*
@ -632,10 +631,10 @@ struct file_buffer {
/* /*
* The following only used in undo.c. * The following only used in undo.c.
*/ */
u_header_T *b_u_oldhead; // pointer to oldest header u_header_T *b_u_oldhead; // pointer to oldest header
u_header_T *b_u_newhead; // pointer to newest header; may not be valid u_header_T *b_u_newhead; // pointer to newest header; may not be valid
// if b_u_curhead is not NULL // if b_u_curhead is not NULL
u_header_T *b_u_curhead; // pointer to current header u_header_T *b_u_curhead; // pointer to current header
int b_u_numhead; // current number of headers int b_u_numhead; // current number of headers
bool b_u_synced; // entry lists are synced bool b_u_synced; // entry lists are synced
long b_u_seq_last; // last used undo sequence number long b_u_seq_last; // last used undo sequence number
@ -647,7 +646,7 @@ struct file_buffer {
/* /*
* variables for "U" command in undo.c * variables for "U" command in undo.c
*/ */
char_u *b_u_line_ptr; // saved line for "U" command char_u *b_u_line_ptr; // saved line for "U" command
linenr_T b_u_line_lnum; // line number of line in u_line linenr_T b_u_line_lnum; // line number of line in u_line
colnr_T b_u_line_colnr; // optional column number colnr_T b_u_line_colnr; // optional column number
@ -659,11 +658,11 @@ struct file_buffer {
#define B_IMODE_USE_INSERT -1 // Use b_p_iminsert value for search #define B_IMODE_USE_INSERT -1 // Use b_p_iminsert value for search
#define B_IMODE_NONE 0 // Input via none #define B_IMODE_NONE 0 // Input via none
#define B_IMODE_LMAP 1 // Input via langmap #define B_IMODE_LMAP 1 // Input via langmap
# define B_IMODE_LAST 1 #define B_IMODE_LAST 1
int16_t b_kmap_state; // using "lmap" mappings int16_t b_kmap_state; // using "lmap" mappings
# define KEYMAP_INIT 1 // 'keymap' was set, call keymap_init() #define KEYMAP_INIT 1 // 'keymap' was set, call keymap_init()
# define KEYMAP_LOADED 2 // 'keymap' mappings have been loaded #define KEYMAP_LOADED 2 // 'keymap' mappings have been loaded
garray_T b_kmap_ga; // the keymap table garray_T b_kmap_ga; // the keymap table
/* /*
@ -818,7 +817,7 @@ struct file_buffer {
int b_start_eol; // last line had eol when it was read int b_start_eol; // last line had eol when it was read
int b_start_ffc; // first char of 'ff' when edit started int b_start_ffc; // first char of 'ff' when edit started
char_u *b_start_fenc; // 'fileencoding' when edit started or NULL char_u *b_start_fenc; // 'fileencoding' when edit started or NULL
int b_bad_char; // "++bad=" argument when edit started or 0 int b_bad_char; // "++bad=" argument when edit started or 0
int b_start_bomb; // 'bomb' when it was read int b_start_bomb; // 'bomb' when it was read
@ -901,7 +900,7 @@ struct file_buffer {
/* /*
* Stuff for diff mode. * Stuff for diff mode.
*/ */
# define DB_COUNT 8 // up to four buffers can be diff'ed #define DB_COUNT 8 // up to four buffers can be diff'ed
/* /*
* Each diffblock defines where a block of lines starts in each of the buffers * Each diffblock defines where a block of lines starts in each of the buffers
@ -919,14 +918,14 @@ struct file_buffer {
*/ */
typedef struct diffblock_S diff_T; typedef struct diffblock_S diff_T;
struct diffblock_S { struct diffblock_S {
diff_T *df_next; diff_T *df_next;
linenr_T df_lnum[DB_COUNT]; // line number in buffer linenr_T df_lnum[DB_COUNT]; // line number in buffer
linenr_T df_count[DB_COUNT]; // nr of inserted/changed lines linenr_T df_count[DB_COUNT]; // nr of inserted/changed lines
}; };
#define SNAP_HELP_IDX 0 #define SNAP_HELP_IDX 0
# define SNAP_AUCMD_IDX 1 #define SNAP_AUCMD_IDX 1
# define SNAP_COUNT 2 #define SNAP_COUNT 2
/// Tab pages point to the top frame of each tab page. /// Tab pages point to the top frame of each tab page.
/// Note: Most values are NOT valid for the current tab page! Use "curwin", /// Note: Most values are NOT valid for the current tab page! Use "curwin",
@ -935,25 +934,25 @@ struct diffblock_S {
typedef struct tabpage_S tabpage_T; typedef struct tabpage_S tabpage_T;
struct tabpage_S { struct tabpage_S {
handle_T handle; handle_T handle;
tabpage_T *tp_next; ///< next tabpage or NULL tabpage_T *tp_next; ///< next tabpage or NULL
frame_T *tp_topframe; ///< topframe for the windows frame_T *tp_topframe; ///< topframe for the windows
win_T *tp_curwin; ///< current window in this Tab page win_T *tp_curwin; ///< current window in this Tab page
win_T *tp_prevwin; ///< previous window in this Tab page win_T *tp_prevwin; ///< previous window in this Tab page
win_T *tp_firstwin; ///< first window in this Tab page win_T *tp_firstwin; ///< first window in this Tab page
win_T *tp_lastwin; ///< last window in this Tab page win_T *tp_lastwin; ///< last window in this Tab page
long tp_old_Rows; ///< Rows when Tab page was left long tp_old_Rows; ///< Rows when Tab page was left
long tp_old_Columns; ///< Columns when Tab page was left long tp_old_Columns; ///< Columns when Tab page was left
long tp_ch_used; ///< value of 'cmdheight' when frame size long tp_ch_used; ///< value of 'cmdheight' when frame size
///< was set ///< was set
diff_T *tp_first_diff; diff_T *tp_first_diff;
buf_T *(tp_diffbuf[DB_COUNT]); buf_T *(tp_diffbuf[DB_COUNT]);
int tp_diff_invalid; ///< list of diffs is outdated int tp_diff_invalid; ///< list of diffs is outdated
int tp_diff_update; ///< update diffs before redrawing int tp_diff_update; ///< update diffs before redrawing
frame_T *(tp_snapshot[SNAP_COUNT]); ///< window layout snapshots frame_T *(tp_snapshot[SNAP_COUNT]); ///< window layout snapshots
ScopeDictDictItem tp_winvar; ///< Variable for "t:" Dictionary. ScopeDictDictItem tp_winvar; ///< Variable for "t:" Dictionary.
dict_T *tp_vars; ///< Internal variables, local to tab page. dict_T *tp_vars; ///< Internal variables, local to tab page.
char_u *tp_localdir; ///< Absolute path of local cwd or NULL. char_u *tp_localdir; ///< Absolute path of local cwd or NULL.
}; };
/* /*
@ -986,14 +985,14 @@ struct frame_S {
int fr_newwidth; // new width used in win_equal_rec() int fr_newwidth; // new width used in win_equal_rec()
int fr_height; int fr_height;
int fr_newheight; // new height used in win_equal_rec() int fr_newheight; // new height used in win_equal_rec()
frame_T *fr_parent; // containing frame or NULL frame_T *fr_parent; // containing frame or NULL
frame_T *fr_next; // frame right or below in same parent, NULL frame_T *fr_next; // frame right or below in same parent, NULL
// for last // for last
frame_T *fr_prev; // frame left or above in same parent, NULL frame_T *fr_prev; // frame left or above in same parent, NULL
// for first // for first
// fr_child and fr_win are mutually exclusive // fr_child and fr_win are mutually exclusive
frame_T *fr_child; // first contained frame frame_T *fr_child; // first contained frame
win_T *fr_win; // window that fills this frame win_T *fr_win; // window that fills this frame
}; };
#define FR_LEAF 0 // frame is a leaf #define FR_LEAF 0 // frame is a leaf
@ -1009,7 +1008,7 @@ struct frame_S {
typedef struct { typedef struct {
regmmatch_T rm; // points to the regexp program; contains last found regmmatch_T rm; // points to the regexp program; contains last found
// match (may continue in next line) // match (may continue in next line)
buf_T *buf; // the buffer to search for a match buf_T *buf; // the buffer to search for a match
linenr_T lnum; // the line to search for a match linenr_T lnum; // the line to search for a match
int attr; // attributes to be used for a match int attr; // attributes to be used for a match
int attr_cur; // attributes currently active in win_line() int attr_cur; // attributes currently active in win_line()
@ -1026,9 +1025,9 @@ typedef struct {
/// Same as lpos_T, but with additional field len. /// Same as lpos_T, but with additional field len.
typedef struct typedef struct
{ {
linenr_T lnum; ///< line number linenr_T lnum; ///< line number
colnr_T col; ///< column number colnr_T col; ///< column number
int len; ///< length: 0 - to the end of line int len; ///< length: 0 - to the end of line
} llpos_T; } llpos_T;
/// posmatch_T provides an array for storing match items for matchaddpos() /// posmatch_T provides an array for storing match items for matchaddpos()
@ -1036,10 +1035,10 @@ typedef struct
typedef struct posmatch posmatch_T; typedef struct posmatch posmatch_T;
struct posmatch struct posmatch
{ {
llpos_T pos[MAXPOSMATCH]; ///< array of positions llpos_T pos[MAXPOSMATCH]; ///< array of positions
int cur; ///< internal position counter int cur; ///< internal position counter
linenr_T toplnum; ///< top buffer line linenr_T toplnum; ///< top buffer line
linenr_T botlnum; ///< bottom buffer line linenr_T botlnum; ///< bottom buffer line
}; };
/* /*
@ -1144,20 +1143,20 @@ typedef struct VimMenu vimmenu_T;
struct VimMenu { struct VimMenu {
int modes; ///< Which modes is this menu visible for int modes; ///< Which modes is this menu visible for
int enabled; ///< for which modes the menu is enabled int enabled; ///< for which modes the menu is enabled
char_u *name; ///< Name of menu, possibly translated char_u *name; ///< Name of menu, possibly translated
char_u *dname; ///< Displayed Name ("name" without '&') char_u *dname; ///< Displayed Name ("name" without '&')
char_u *en_name; ///< "name" untranslated, NULL when char_u *en_name; ///< "name" untranslated, NULL when
///< was not translated ///< was not translated
char_u *en_dname; ///< NULL when "dname" untranslated char_u *en_dname; ///< NULL when "dname" untranslated
int mnemonic; ///< mnemonic key (after '&') int mnemonic; ///< mnemonic key (after '&')
char_u *actext; ///< accelerator text (after TAB) char_u *actext; ///< accelerator text (after TAB)
long priority; ///< Menu order priority long priority; ///< Menu order priority
char_u *strings[MENU_MODES]; ///< Mapped string for each mode char_u *strings[MENU_MODES]; ///< Mapped string for each mode
int noremap[MENU_MODES]; ///< A \ref REMAP_VALUES flag for each mode int noremap[MENU_MODES]; ///< A \ref REMAP_VALUES flag for each mode
bool silent[MENU_MODES]; ///< A silent flag for each mode bool silent[MENU_MODES]; ///< A silent flag for each mode
vimmenu_T *children; ///< Children of sub-menu vimmenu_T *children; ///< Children of sub-menu
vimmenu_T *parent; ///< Parent of menu vimmenu_T *parent; ///< Parent of menu
vimmenu_T *next; ///< Next item in menu vimmenu_T *next; ///< Next item in menu
}; };
/// Structure which contains all information that belongs to a window. /// Structure which contains all information that belongs to a window.
@ -1166,10 +1165,10 @@ struct VimMenu {
struct window_S { struct window_S {
handle_T handle; ///< unique identifier for the window handle_T handle; ///< unique identifier for the window
buf_T *w_buffer; ///< buffer we are a window into (used buf_T *w_buffer; ///< buffer we are a window into (used
///< often, keep it the first item!) ///< often, keep it the first item!)
synblock_T *w_s; ///< for :ownsyntax synblock_T *w_s; ///< for :ownsyntax
int w_hl_id_normal; ///< 'winhighlight' normal id int w_hl_id_normal; ///< 'winhighlight' normal id
int w_hl_attr_normal; ///< 'winhighlight' normal final attrs int w_hl_attr_normal; ///< 'winhighlight' normal final attrs
@ -1179,12 +1178,12 @@ struct window_S {
int w_hl_needs_update; ///< attrs need to be recalculated int w_hl_needs_update; ///< attrs need to be recalculated
win_T *w_prev; ///< link to previous window win_T *w_prev; ///< link to previous window
win_T *w_next; ///< link to next window win_T *w_next; ///< link to next window
bool w_closing; ///< window is being closed, don't let bool w_closing; ///< window is being closed, don't let
/// autocommands close it too. /// autocommands close it too.
frame_T *w_frame; ///< frame containing this window frame_T *w_frame; ///< frame containing this window
pos_T w_cursor; ///< cursor position in buffer pos_T w_cursor; ///< cursor position in buffer
@ -1345,7 +1344,7 @@ struct window_S {
* This is used for efficient redrawing. * This is used for efficient redrawing.
*/ */
int w_lines_valid; // number of valid entries int w_lines_valid; // number of valid entries
wline_T *w_lines; wline_T *w_lines;
garray_T w_folds; // array of nested folds garray_T w_folds; // array of nested folds
bool w_fold_manual; // when true: some folds are opened/closed bool w_fold_manual; // when true: some folds are opened/closed
@ -1377,13 +1376,13 @@ struct window_S {
int w_alt_fnum; // alternate file (for # and CTRL-^) int w_alt_fnum; // alternate file (for # and CTRL-^)
alist_T *w_alist; // pointer to arglist for this window alist_T *w_alist; // pointer to arglist for this window
int w_arg_idx; // current index in argument list (can be int w_arg_idx; // current index in argument list (can be
// out of range!) // out of range!)
int w_arg_idx_invalid; // editing another file than w_arg_idx int w_arg_idx_invalid; // editing another file than w_arg_idx
char_u *w_localdir; /* absolute path of local directory or char_u *w_localdir; /* absolute path of local directory or
NULL */ NULL */
// Options local to a window. // Options local to a window.
// They are local because they influence the layout of the window or // They are local because they influence the layout of the window or
// depend on the window layout. // depend on the window layout.
@ -1396,10 +1395,10 @@ struct window_S {
uint32_t w_p_stl_flags; // flags for 'statusline' uint32_t w_p_stl_flags; // flags for 'statusline'
uint32_t w_p_fde_flags; // flags for 'foldexpr' uint32_t w_p_fde_flags; // flags for 'foldexpr'
uint32_t w_p_fdt_flags; // flags for 'foldtext' uint32_t w_p_fdt_flags; // flags for 'foldtext'
int *w_p_cc_cols; // array of columns to highlight or NULL int *w_p_cc_cols; // array of columns to highlight or NULL
char_u w_p_culopt_flags; // flags for cursorline highlighting char_u w_p_culopt_flags; // flags for cursorline highlighting
long w_p_siso; // 'sidescrolloff' local value long w_p_siso; // 'sidescrolloff' local value
long w_p_so; // 'scrolloff' local value long w_p_so; // 'scrolloff' local value
int w_briopt_min; // minimum width for breakindent int w_briopt_min; // minimum width for breakindent
int w_briopt_shift; // additional shift for breakindent int w_briopt_shift; // additional shift for breakindent
@ -1463,10 +1462,10 @@ struct window_S {
* was computed. */ * was computed. */
int w_nrwidth_width; // nr of chars to print line count. int w_nrwidth_width; // nr of chars to print line count.
qf_info_T *w_llist; // Location list for this window qf_info_T *w_llist; // Location list for this window
// Location list reference used in the location list window. // Location list reference used in the location list window.
// In a non-location list window, w_llist_ref is NULL. // In a non-location list window, w_llist_ref is NULL.
qf_info_T *w_llist_ref; qf_info_T *w_llist_ref;
}; };
static inline int win_hl_attr(win_T *wp, int hlf) static inline int win_hl_attr(win_T *wp, int hlf)
@ -1476,6 +1475,6 @@ static inline int win_hl_attr(win_T *wp, int hlf)
/// Macros defined in Vim, but not in Neovim /// Macros defined in Vim, but not in Neovim
#define CHANGEDTICK(buf) \ #define CHANGEDTICK(buf) \
(=== Include buffer.h & use buf_(get|set|inc)_changedtick ===) (=== Include buffer.h & use buf_(get|set|inc) _changedtick ===)
#endif // NVIM_BUFFER_DEFS_H #endif // NVIM_BUFFER_DEFS_H

View File

@ -1,13 +1,13 @@
#ifndef NVIM_CHANNEL_H #ifndef NVIM_CHANNEL_H
#define NVIM_CHANNEL_H #define NVIM_CHANNEL_H
#include "nvim/main.h"
#include "nvim/event/socket.h"
#include "nvim/event/process.h"
#include "nvim/os/pty_process.h"
#include "nvim/event/libuv_process.h"
#include "nvim/eval/typval.h" #include "nvim/eval/typval.h"
#include "nvim/event/libuv_process.h"
#include "nvim/event/process.h"
#include "nvim/event/socket.h"
#include "nvim/main.h"
#include "nvim/msgpack_rpc/channel_defs.h" #include "nvim/msgpack_rpc/channel_defs.h"
#include "nvim/os/pty_process.h"
#define CHAN_STDIO 1 #define CHAN_STDIO 1
#define CHAN_STDERR 2 #define CHAN_STDERR 2
@ -105,18 +105,18 @@ static inline Stream *channel_instream(Channel *chan)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_ALL
{ {
switch (chan->streamtype) { switch (chan->streamtype) {
case kChannelStreamProc: case kChannelStreamProc:
return &chan->stream.proc.in; return &chan->stream.proc.in;
case kChannelStreamSocket: case kChannelStreamSocket:
return &chan->stream.socket; return &chan->stream.socket;
case kChannelStreamStdio: case kChannelStreamStdio:
return &chan->stream.stdio.out; return &chan->stream.stdio.out;
case kChannelStreamInternal: case kChannelStreamInternal:
case kChannelStreamStderr: case kChannelStreamStderr:
abort(); abort();
} }
abort(); abort();
} }
@ -125,18 +125,18 @@ static inline Stream *channel_outstream(Channel *chan)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_ALL
{ {
switch (chan->streamtype) { switch (chan->streamtype) {
case kChannelStreamProc: case kChannelStreamProc:
return &chan->stream.proc.out; return &chan->stream.proc.out;
case kChannelStreamSocket: case kChannelStreamSocket:
return &chan->stream.socket; return &chan->stream.socket;
case kChannelStreamStdio: case kChannelStreamStdio:
return &chan->stream.stdio.in; return &chan->stream.stdio.in;
case kChannelStreamInternal: case kChannelStreamInternal:
case kChannelStreamStderr: case kChannelStreamStderr:
abort(); abort();
} }
abort(); abort();
} }

View File

@ -1,11 +1,11 @@
#ifndef NVIM_CHARSET_H #ifndef NVIM_CHARSET_H
#define NVIM_CHARSET_H #define NVIM_CHARSET_H
#include "nvim/types.h"
#include "nvim/pos.h"
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/eval/typval.h" #include "nvim/eval/typval.h"
#include "nvim/option_defs.h" #include "nvim/option_defs.h"
#include "nvim/pos.h"
#include "nvim/types.h"
/// Return the folded-case equivalent of the given character /// Return the folded-case equivalent of the given character
/// ///
@ -13,7 +13,7 @@
/// ///
/// @return Folded variant. /// @return Folded variant.
#define CH_FOLD(c) \ #define CH_FOLD(c) \
utf_fold((sizeof(c) == sizeof(char)) \ utf_fold((sizeof(c) == sizeof(char)) \
?((int)(uint8_t)(c)) \ ?((int)(uint8_t)(c)) \
:((int)(c))) :((int)(c)))

View File

@ -2,6 +2,7 @@
#define NVIM_CONTEXT_H #define NVIM_CONTEXT_H
#include <msgpack.h> #include <msgpack.h>
#include "nvim/api/private/defs.h" #include "nvim/api/private/defs.h"
#include "nvim/lib/kvec.h" #include "nvim/lib/kvec.h"

View File

@ -1,36 +1,36 @@
#ifndef NVIM_CURSOR_SHAPE_H #ifndef NVIM_CURSOR_SHAPE_H
#define NVIM_CURSOR_SHAPE_H #define NVIM_CURSOR_SHAPE_H
#include "nvim/types.h"
#include "nvim/api/private/defs.h" #include "nvim/api/private/defs.h"
#include "nvim/types.h"
/// struct to store values from 'guicursor' and 'mouseshape' /// struct to store values from 'guicursor' and 'mouseshape'
/// Indexes in shape_table[] /// Indexes in shape_table[]
typedef enum { typedef enum {
SHAPE_IDX_N = 0, ///< Normal mode SHAPE_IDX_N = 0, ///< Normal mode
SHAPE_IDX_V = 1, ///< Visual mode SHAPE_IDX_V = 1, ///< Visual mode
SHAPE_IDX_I = 2, ///< Insert mode SHAPE_IDX_I = 2, ///< Insert mode
SHAPE_IDX_R = 3, ///< Replace mode SHAPE_IDX_R = 3, ///< Replace mode
SHAPE_IDX_C = 4, ///< Command line Normal mode SHAPE_IDX_C = 4, ///< Command line Normal mode
SHAPE_IDX_CI = 5, ///< Command line Insert mode SHAPE_IDX_CI = 5, ///< Command line Insert mode
SHAPE_IDX_CR = 6, ///< Command line Replace mode SHAPE_IDX_CR = 6, ///< Command line Replace mode
SHAPE_IDX_O = 7, ///< Operator-pending mode SHAPE_IDX_O = 7, ///< Operator-pending mode
SHAPE_IDX_VE = 8, ///< Visual mode with 'selection' exclusive SHAPE_IDX_VE = 8, ///< Visual mode with 'selection' exclusive
SHAPE_IDX_CLINE = 9, ///< On command line SHAPE_IDX_CLINE = 9, ///< On command line
SHAPE_IDX_STATUS = 10, ///< On status line SHAPE_IDX_STATUS = 10, ///< On status line
SHAPE_IDX_SDRAG = 11, ///< dragging a status line SHAPE_IDX_SDRAG = 11, ///< dragging a status line
SHAPE_IDX_VSEP = 12, ///< On vertical separator line SHAPE_IDX_VSEP = 12, ///< On vertical separator line
SHAPE_IDX_VDRAG = 13, ///< dragging a vertical separator line SHAPE_IDX_VDRAG = 13, ///< dragging a vertical separator line
SHAPE_IDX_MORE = 14, ///< Hit-return or More SHAPE_IDX_MORE = 14, ///< Hit-return or More
SHAPE_IDX_MOREL = 15, ///< Hit-return or More in last line SHAPE_IDX_MOREL = 15, ///< Hit-return or More in last line
SHAPE_IDX_SM = 16, ///< showing matching paren SHAPE_IDX_SM = 16, ///< showing matching paren
SHAPE_IDX_COUNT = 17 SHAPE_IDX_COUNT = 17
} ModeShape; } ModeShape;
typedef enum { typedef enum {
SHAPE_BLOCK = 0, ///< block cursor SHAPE_BLOCK = 0, ///< block cursor
SHAPE_HOR = 1, ///< horizontal bar cursor SHAPE_HOR = 1, ///< horizontal bar cursor
SHAPE_VER = 2 ///< vertical bar cursor SHAPE_VER = 2 ///< vertical bar cursor
} CursorShape; } CursorShape;
#define MSHAPE_NUMBERED 1000 // offset for shapes identified by number #define MSHAPE_NUMBERED 1000 // offset for shapes identified by number

View File

@ -1,9 +1,9 @@
#ifndef NVIM_DECORATION_H #ifndef NVIM_DECORATION_H
#define NVIM_DECORATION_H #define NVIM_DECORATION_H
#include "nvim/pos.h"
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/extmark_defs.h" #include "nvim/extmark_defs.h"
#include "nvim/pos.h"
// actual Decoration data is in extmark_defs.h // actual Decoration data is in extmark_defs.h
@ -82,9 +82,9 @@ EXTERN DecorState decor_state INIT(= { 0 });
EXTERN bool provider_active INIT(= false); EXTERN bool provider_active INIT(= false);
#define DECORATION_PROVIDER_INIT(ns_id) (DecorProvider) \ #define DECORATION_PROVIDER_INIT(ns_id) (DecorProvider) \
{ ns_id, false, LUA_NOREF, LUA_NOREF, \ { ns_id, false, LUA_NOREF, LUA_NOREF, \
LUA_NOREF, LUA_NOREF, LUA_NOREF, \ LUA_NOREF, LUA_NOREF, LUA_NOREF, \
LUA_NOREF, -1 } LUA_NOREF, -1 }
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "decoration.h.generated.h" # include "decoration.h.generated.h"

View File

@ -1,8 +1,8 @@
#ifndef NVIM_DIFF_H #ifndef NVIM_DIFF_H
#define NVIM_DIFF_H #define NVIM_DIFF_H
#include "nvim/pos.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/pos.h"
// Value set from 'diffopt'. // Value set from 'diffopt'.
EXTERN int diff_context INIT(= 6); // context for folds EXTERN int diff_context INIT(= 6); // context for folds

View File

@ -1,8 +1,8 @@
#ifndef NVIM_DIGRAPH_H #ifndef NVIM_DIGRAPH_H
#define NVIM_DIGRAPH_H #define NVIM_DIGRAPH_H
#include "nvim/types.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/types.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "digraph.h.generated.h" # include "digraph.h.generated.h"

View File

@ -24,27 +24,27 @@ typedef enum {
typedef int (*IndentGetter)(void); typedef int (*IndentGetter)(void);
/* Values for in_cinkeys() */ // Values for in_cinkeys()
#define KEY_OPEN_FORW 0x101 #define KEY_OPEN_FORW 0x101
#define KEY_OPEN_BACK 0x102 #define KEY_OPEN_BACK 0x102
#define KEY_COMPLETE 0x103 /* end of completion */ #define KEY_COMPLETE 0x103 // end of completion
/* Values for change_indent() */ // Values for change_indent()
#define INDENT_SET 1 /* set indent */ #define INDENT_SET 1 // set indent
#define INDENT_INC 2 /* increase indent */ #define INDENT_INC 2 // increase indent
#define INDENT_DEC 3 /* decrease indent */ #define INDENT_DEC 3 // decrease indent
/* flags for beginline() */ // flags for beginline()
#define BL_WHITE 1 /* cursor on first non-white in the line */ #define BL_WHITE 1 // cursor on first non-white in the line
#define BL_SOL 2 /* use 'sol' option */ #define BL_SOL 2 // use 'sol' option
#define BL_FIX 4 /* don't leave cursor on a NUL */ #define BL_FIX 4 // don't leave cursor on a NUL
/* flags for insertchar() */ // flags for insertchar()
#define INSCHAR_FORMAT 1 /* force formatting */ #define INSCHAR_FORMAT 1 // force formatting
#define INSCHAR_DO_COM 2 /* format comments */ #define INSCHAR_DO_COM 2 // format comments
#define INSCHAR_CTRLV 4 /* char typed just after CTRL-V */ #define INSCHAR_CTRLV 4 // char typed just after CTRL-V
#define INSCHAR_NO_FEX 8 /* don't use 'formatexpr' */ #define INSCHAR_NO_FEX 8 // don't use 'formatexpr'
#define INSCHAR_COM_LIST 16 /* format comments with list/2nd line indent */ #define INSCHAR_COM_LIST 16 // format comments with list/2nd line indent
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "edit.h.generated.h" # include "edit.h.generated.h"

View File

@ -3,7 +3,7 @@
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/channel.h" #include "nvim/channel.h"
#include "nvim/eval/funcs.h" // For FunPtr #include "nvim/eval/funcs.h" // For FunPtr
#include "nvim/event/time.h" // For TimeWatcher #include "nvim/event/time.h" // For TimeWatcher
#include "nvim/ex_cmds_defs.h" // For exarg_T #include "nvim/ex_cmds_defs.h" // For exarg_T
#include "nvim/os/fileio.h" // For FileDescriptor #include "nvim/os/fileio.h" // For FileDescriptor
@ -24,46 +24,46 @@ EXTERN ufunc_T dumuf;
/* /*
* Structure returned by get_lval() and used by set_var_lval(). * Structure returned by get_lval() and used by set_var_lval().
* For a plain name: * For a plain name:
* "name" points to the variable name. * "name" points to the variable name.
* "exp_name" is NULL. * "exp_name" is NULL.
* "tv" is NULL * "tv" is NULL
* For a magic braces name: * For a magic braces name:
* "name" points to the expanded variable name. * "name" points to the expanded variable name.
* "exp_name" is non-NULL, to be freed later. * "exp_name" is non-NULL, to be freed later.
* "tv" is NULL * "tv" is NULL
* For an index in a list: * For an index in a list:
* "name" points to the (expanded) variable name. * "name" points to the (expanded) variable name.
* "exp_name" NULL or non-NULL, to be freed later. * "exp_name" NULL or non-NULL, to be freed later.
* "tv" points to the (first) list item value * "tv" points to the (first) list item value
* "li" points to the (first) list item * "li" points to the (first) list item
* "range", "n1", "n2" and "empty2" indicate what items are used. * "range", "n1", "n2" and "empty2" indicate what items are used.
* For an existing Dict item: * For an existing Dict item:
* "name" points to the (expanded) variable name. * "name" points to the (expanded) variable name.
* "exp_name" NULL or non-NULL, to be freed later. * "exp_name" NULL or non-NULL, to be freed later.
* "tv" points to the dict item value * "tv" points to the dict item value
* "newkey" is NULL * "newkey" is NULL
* For a non-existing Dict item: * For a non-existing Dict item:
* "name" points to the (expanded) variable name. * "name" points to the (expanded) variable name.
* "exp_name" NULL or non-NULL, to be freed later. * "exp_name" NULL or non-NULL, to be freed later.
* "tv" points to the Dictionary typval_T * "tv" points to the Dictionary typval_T
* "newkey" is the key for the new item. * "newkey" is the key for the new item.
*/ */
typedef struct lval_S { typedef struct lval_S {
const char *ll_name; ///< Start of variable name (can be NULL). const char *ll_name; ///< Start of variable name (can be NULL).
size_t ll_name_len; ///< Length of the .ll_name. size_t ll_name_len; ///< Length of the .ll_name.
char *ll_exp_name; ///< NULL or expanded name in allocated memory. char *ll_exp_name; ///< NULL or expanded name in allocated memory.
typval_T *ll_tv; ///< Typeval of item being used. If "newkey" typval_T *ll_tv; ///< Typeval of item being used. If "newkey"
///< isn't NULL it's the Dict to which to add the item. ///< isn't NULL it's the Dict to which to add the item.
listitem_T *ll_li; ///< The list item or NULL. listitem_T *ll_li; ///< The list item or NULL.
list_T *ll_list; ///< The list or NULL. list_T *ll_list; ///< The list or NULL.
bool ll_range; ///< true when a [i:j] range was used. bool ll_range; ///< true when a [i:j] range was used.
bool ll_empty2; ///< Second index is empty: [i:]. bool ll_empty2; ///< Second index is empty: [i:].
long ll_n1; ///< First index for list. long ll_n1; ///< First index for list.
long ll_n2; ///< Second index for list range. long ll_n2; ///< Second index for list range.
dict_T *ll_dict; ///< The Dictionary or NULL. dict_T *ll_dict; ///< The Dictionary or NULL.
dictitem_T *ll_di; ///< The dictitem or NULL. dictitem_T *ll_di; ///< The dictitem or NULL.
char_u *ll_newkey; ///< New key for Dict in allocated memory or NULL. char_u *ll_newkey; ///< New key for Dict in allocated memory or NULL.
blob_T *ll_blob; ///< The Blob or NULL. blob_T *ll_blob; ///< The Blob or NULL.
} lval_T; } lval_T;
/// enum used by var_flavour() /// enum used by var_flavour()
@ -75,100 +75,100 @@ typedef enum {
/// Defines for Vim variables /// Defines for Vim variables
typedef enum { typedef enum {
VV_COUNT, VV_COUNT,
VV_COUNT1, VV_COUNT1,
VV_PREVCOUNT, VV_PREVCOUNT,
VV_ERRMSG, VV_ERRMSG,
VV_WARNINGMSG, VV_WARNINGMSG,
VV_STATUSMSG, VV_STATUSMSG,
VV_SHELL_ERROR, VV_SHELL_ERROR,
VV_THIS_SESSION, VV_THIS_SESSION,
VV_VERSION, VV_VERSION,
VV_LNUM, VV_LNUM,
VV_TERMRESPONSE, VV_TERMRESPONSE,
VV_FNAME, VV_FNAME,
VV_LANG, VV_LANG,
VV_LC_TIME, VV_LC_TIME,
VV_CTYPE, VV_CTYPE,
VV_CC_FROM, VV_CC_FROM,
VV_CC_TO, VV_CC_TO,
VV_FNAME_IN, VV_FNAME_IN,
VV_FNAME_OUT, VV_FNAME_OUT,
VV_FNAME_NEW, VV_FNAME_NEW,
VV_FNAME_DIFF, VV_FNAME_DIFF,
VV_CMDARG, VV_CMDARG,
VV_FOLDSTART, VV_FOLDSTART,
VV_FOLDEND, VV_FOLDEND,
VV_FOLDDASHES, VV_FOLDDASHES,
VV_FOLDLEVEL, VV_FOLDLEVEL,
VV_PROGNAME, VV_PROGNAME,
VV_SEND_SERVER, VV_SEND_SERVER,
VV_DYING, VV_DYING,
VV_EXCEPTION, VV_EXCEPTION,
VV_THROWPOINT, VV_THROWPOINT,
VV_REG, VV_REG,
VV_CMDBANG, VV_CMDBANG,
VV_INSERTMODE, VV_INSERTMODE,
VV_VAL, VV_VAL,
VV_KEY, VV_KEY,
VV_PROFILING, VV_PROFILING,
VV_FCS_REASON, VV_FCS_REASON,
VV_FCS_CHOICE, VV_FCS_CHOICE,
VV_BEVAL_BUFNR, VV_BEVAL_BUFNR,
VV_BEVAL_WINNR, VV_BEVAL_WINNR,
VV_BEVAL_WINID, VV_BEVAL_WINID,
VV_BEVAL_LNUM, VV_BEVAL_LNUM,
VV_BEVAL_COL, VV_BEVAL_COL,
VV_BEVAL_TEXT, VV_BEVAL_TEXT,
VV_SCROLLSTART, VV_SCROLLSTART,
VV_SWAPNAME, VV_SWAPNAME,
VV_SWAPCHOICE, VV_SWAPCHOICE,
VV_SWAPCOMMAND, VV_SWAPCOMMAND,
VV_CHAR, VV_CHAR,
VV_MOUSE_WIN, VV_MOUSE_WIN,
VV_MOUSE_WINID, VV_MOUSE_WINID,
VV_MOUSE_LNUM, VV_MOUSE_LNUM,
VV_MOUSE_COL, VV_MOUSE_COL,
VV_OP, VV_OP,
VV_SEARCHFORWARD, VV_SEARCHFORWARD,
VV_HLSEARCH, VV_HLSEARCH,
VV_OLDFILES, VV_OLDFILES,
VV_WINDOWID, VV_WINDOWID,
VV_PROGPATH, VV_PROGPATH,
VV_COMPLETED_ITEM, VV_COMPLETED_ITEM,
VV_OPTION_NEW, VV_OPTION_NEW,
VV_OPTION_OLD, VV_OPTION_OLD,
VV_OPTION_TYPE, VV_OPTION_TYPE,
VV_ERRORS, VV_ERRORS,
VV_FALSE, VV_FALSE,
VV_TRUE, VV_TRUE,
VV_NULL, VV_NULL,
VV_NUMBERMAX, VV_NUMBERMAX,
VV_NUMBERMIN, VV_NUMBERMIN,
VV_NUMBERSIZE, VV_NUMBERSIZE,
VV_VIM_DID_ENTER, VV_VIM_DID_ENTER,
VV_TESTING, VV_TESTING,
VV_TYPE_NUMBER, VV_TYPE_NUMBER,
VV_TYPE_STRING, VV_TYPE_STRING,
VV_TYPE_FUNC, VV_TYPE_FUNC,
VV_TYPE_LIST, VV_TYPE_LIST,
VV_TYPE_DICT, VV_TYPE_DICT,
VV_TYPE_FLOAT, VV_TYPE_FLOAT,
VV_TYPE_BOOL, VV_TYPE_BOOL,
VV_TYPE_BLOB, VV_TYPE_BLOB,
VV_EVENT, VV_EVENT,
VV_ECHOSPACE, VV_ECHOSPACE,
VV_ARGV, VV_ARGV,
VV_COLLATE, VV_COLLATE,
VV_EXITING, VV_EXITING,
// Neovim // Neovim
VV_STDERR, VV_STDERR,
VV_MSGPACK_TYPES, VV_MSGPACK_TYPES,
VV__NULL_STRING, // String with NULL value. For test purposes only. VV__NULL_STRING, // String with NULL value. For test purposes only.
VV__NULL_LIST, // List with NULL value. For test purposes only. VV__NULL_LIST, // List with NULL value. For test purposes only.
VV__NULL_DICT, // Dictionary with NULL value. For test purposes only. VV__NULL_DICT, // Dictionary with NULL value. For test purposes only.
VV__NULL_BLOB, // Blob with NULL value. For test purposes only. VV__NULL_BLOB, // Blob with NULL value. For test purposes only.
VV_LUA, VV_LUA,
} VimVarIndex; } VimVarIndex;
/// All recognized msgpack types /// All recognized msgpack types
@ -208,7 +208,7 @@ typedef enum {
} GetLvalFlags; } GetLvalFlags;
/// flags for find_name_end() /// flags for find_name_end()
#define FNE_INCL_BR 1 /* find_name_end(): include [] in name */ #define FNE_INCL_BR 1 // find_name_end(): include [] in name
#define FNE_CHECK_START 2 /* find_name_end(): check name starts with #define FNE_CHECK_START 2 /* find_name_end(): check name starts with
valid character */ valid character */

View File

@ -3,11 +3,11 @@
#include <stdbool.h> #include <stdbool.h>
#include "nvim/buffer_defs.h"
#include "nvim/eval/typval.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/os/time.h" #include "nvim/os/time.h"
#include "nvim/pos.h" #include "nvim/pos.h"
#include "nvim/eval/typval.h"
#include "nvim/buffer_defs.h"
#include "nvim/ex_cmds_defs.h"
// flags for do_ecmd() // flags for do_ecmd()
#define ECMD_HIDE 0x01 // don't free the current buffer #define ECMD_HIDE 0x01 // don't free the current buffer
@ -18,10 +18,10 @@
#define ECMD_ADDBUF 0x10 // don't edit, just add to buffer list #define ECMD_ADDBUF 0x10 // don't edit, just add to buffer list
#define ECMD_ALTBUF 0x20 // like ECMD_ADDBUF and set the alternate file #define ECMD_ALTBUF 0x20 // like ECMD_ADDBUF and set the alternate file
/* for lnum argument in do_ecmd() */ // for lnum argument in do_ecmd()
#define ECMD_LASTL (linenr_T)0 /* use last position in loaded file */ #define ECMD_LASTL (linenr_T)0 // use last position in loaded file
#define ECMD_LAST (linenr_T)-1 /* use last position in all files */ #define ECMD_LAST (linenr_T)-1 // use last position in all files
#define ECMD_ONE (linenr_T)1 /* use first line */ #define ECMD_ONE (linenr_T)1 // use first line
/// Previous :substitute replacement string definition /// Previous :substitute replacement string definition
typedef struct { typedef struct {

View File

@ -4,8 +4,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include "nvim/pos.h" // for linenr_T
#include "nvim/normal.h" #include "nvim/normal.h"
#include "nvim/pos.h" // for linenr_T
#include "nvim/regexp_defs.h" #include "nvim/regexp_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
@ -83,10 +83,10 @@ typedef enum {
typedef struct exarg exarg_T; typedef struct exarg exarg_T;
/* behavior for bad character, "++bad=" argument */ // behavior for bad character, "++bad=" argument
#define BAD_REPLACE '?' /* replace it with '?' (default) */ #define BAD_REPLACE '?' // replace it with '?' (default)
#define BAD_KEEP -1 /* leave it */ #define BAD_KEEP -1 // leave it
#define BAD_DROP -2 /* erase it */ #define BAD_DROP -2 // erase it
typedef void (*ex_func_T)(exarg_T *eap); typedef void (*ex_func_T)(exarg_T *eap);
@ -130,8 +130,8 @@ typedef struct {
eslist_T *cs_emsg_silent_list; // saved values of "emsg_silent" eslist_T *cs_emsg_silent_list; // saved values of "emsg_silent"
int cs_lflags; // loop flags: CSL_ flags int cs_lflags; // loop flags: CSL_ flags
} cstack_T; } cstack_T;
# define cs_rettv cs_pend.csp_rv #define cs_rettv cs_pend.csp_rv
# define cs_exception cs_pend.csp_ex #define cs_exception cs_pend.csp_ex
// Flags for the cs_lflags item in cstack_T. // Flags for the cs_lflags item in cstack_T.
enum { enum {
@ -143,10 +143,10 @@ enum {
/// Arguments used for Ex commands. /// Arguments used for Ex commands.
struct exarg { struct exarg {
char_u *arg; ///< argument of the command char_u *arg; ///< argument of the command
char_u *nextcmd; ///< next command (NULL if none) char_u *nextcmd; ///< next command (NULL if none)
char_u *cmd; ///< the name of the command (except for :make) char_u *cmd; ///< the name of the command (except for :make)
char_u **cmdlinep; ///< pointer to pointer of allocated cmdline char_u **cmdlinep; ///< pointer to pointer of allocated cmdline
cmdidx_T cmdidx; ///< the index for the command cmdidx_T cmdidx; ///< the index for the command
uint32_t argt; ///< flags for the command uint32_t argt; ///< flags for the command
int skip; ///< don't execute the command, only parse it int skip; ///< don't execute the command, only parse it
@ -156,7 +156,7 @@ struct exarg {
linenr_T line2; ///< the second line number or count linenr_T line2; ///< the second line number or count
cmd_addr_T addr_type; ///< type of the count/range cmd_addr_T addr_type; ///< type of the count/range
int flags; ///< extra flags after count: EXFLAG_ int flags; ///< extra flags after count: EXFLAG_
char_u *do_ecmd_cmd; ///< +command arg to be used in edited file char_u *do_ecmd_cmd; ///< +command arg to be used in edited file
linenr_T do_ecmd_lnum; ///< the line number in an edited file linenr_T do_ecmd_lnum; ///< the line number in an edited file
int append; ///< TRUE with ":w >>file" command int append; ///< TRUE with ":w >>file" command
int usefilter; ///< TRUE with ":w !command" and ":r!command" int usefilter; ///< TRUE with ":w !command" and ":r!command"
@ -170,7 +170,7 @@ struct exarg {
int useridx; ///< user command index int useridx; ///< user command index
char_u *errmsg; ///< returned error message char_u *errmsg; ///< returned error message
LineGetter getline; ///< Function used to get the next line LineGetter getline; ///< Function used to get the next line
void *cookie; ///< argument for getline() void *cookie; ///< argument for getline()
cstack_T *cstack; ///< condition stack for ":if" etc. cstack_T *cstack; ///< condition stack for ":if" etc.
long verbose_save; ///< saved value of p_verbose long verbose_save; ///< saved value of p_verbose
int save_msg_silent; ///< saved value of msg_silent int save_msg_silent; ///< saved value of msg_silent

View File

@ -13,7 +13,7 @@
#define DOCMD_KEEPLINE 0x20 // keep typed line for repeating with "." #define DOCMD_KEEPLINE 0x20 // keep typed line for repeating with "."
#define DOCMD_PREVIEW 0x40 // during 'inccommand' preview #define DOCMD_PREVIEW 0x40 // during 'inccommand' preview
/* defines for eval_vars() */ // defines for eval_vars()
#define VALID_PATH 1 #define VALID_PATH 1
#define VALID_HEAD 2 #define VALID_HEAD 2

View File

@ -1,22 +1,22 @@
#ifndef NVIM_EX_EVAL_H #ifndef NVIM_EX_EVAL_H
#define NVIM_EX_EVAL_H #define NVIM_EX_EVAL_H
#include "nvim/pos.h" // for linenr_T
#include "nvim/ex_cmds_defs.h" // for exarg_T #include "nvim/ex_cmds_defs.h" // for exarg_T
#include "nvim/pos.h" // for linenr_T
/* There is no CSF_IF, the lack of CSF_WHILE, CSF_FOR and CSF_TRY means ":if" /* There is no CSF_IF, the lack of CSF_WHILE, CSF_FOR and CSF_TRY means ":if"
* was used. */ * was used. */
# define CSF_TRUE 0x0001 /* condition was TRUE */ #define CSF_TRUE 0x0001 // condition was TRUE
# define CSF_ACTIVE 0x0002 /* current state is active */ #define CSF_ACTIVE 0x0002 // current state is active
# define CSF_ELSE 0x0004 /* ":else" has been passed */ #define CSF_ELSE 0x0004 // ":else" has been passed
# define CSF_WHILE 0x0008 /* is a ":while" */ #define CSF_WHILE 0x0008 // is a ":while"
# define CSF_FOR 0x0010 /* is a ":for" */ #define CSF_FOR 0x0010 // is a ":for"
# define CSF_TRY 0x0100 /* is a ":try" */ #define CSF_TRY 0x0100 // is a ":try"
# define CSF_FINALLY 0x0200 /* ":finally" has been passed */ #define CSF_FINALLY 0x0200 // ":finally" has been passed
# define CSF_THROWN 0x0400 /* exception thrown to this try conditional */ #define CSF_THROWN 0x0400 // exception thrown to this try conditional
# define CSF_CAUGHT 0x0800 /* exception caught by this try conditional */ #define CSF_CAUGHT 0x0800 // exception caught by this try conditional
# define CSF_SILENT 0x1000 /* "emsg_silent" reset by ":try" */ #define CSF_SILENT 0x1000 // "emsg_silent" reset by ":try"
/* Note that CSF_ELSE is only used when CSF_TRY and CSF_WHILE are unset /* Note that CSF_ELSE is only used when CSF_TRY and CSF_WHILE are unset
* (an ":if"), and CSF_SILENT is only used when CSF_TRY is set. */ * (an ":if"), and CSF_SILENT is only used when CSF_TRY is set. */
@ -24,14 +24,14 @@
* What's pending for being reactivated at the ":endtry" of this try * What's pending for being reactivated at the ":endtry" of this try
* conditional: * conditional:
*/ */
# define CSTP_NONE 0 /* nothing pending in ":finally" clause */ #define CSTP_NONE 0 // nothing pending in ":finally" clause
# define CSTP_ERROR 1 /* an error is pending */ #define CSTP_ERROR 1 // an error is pending
# define CSTP_INTERRUPT 2 /* an interrupt is pending */ #define CSTP_INTERRUPT 2 // an interrupt is pending
# define CSTP_THROW 4 /* a throw is pending */ #define CSTP_THROW 4 // a throw is pending
# define CSTP_BREAK 8 /* ":break" is pending */ #define CSTP_BREAK 8 // ":break" is pending
# define CSTP_CONTINUE 16 /* ":continue" is pending */ #define CSTP_CONTINUE 16 // ":continue" is pending
# define CSTP_RETURN 24 /* ":return" is pending */ #define CSTP_RETURN 24 // ":return" is pending
# define CSTP_FINISH 32 /* ":finish" is pending */ #define CSTP_FINISH 32 // ":finish" is pending
/* /*
* A list of error messages that can be converted to an exception. "throw_msg" * A list of error messages that can be converted to an exception. "throw_msg"
@ -40,9 +40,9 @@
* message in the list. See cause_errthrow() below. * message in the list. See cause_errthrow() below.
*/ */
struct msglist { struct msglist {
char_u *msg; /* original message */ char_u *msg; // original message
char_u *throw_msg; /* msg to throw: usually original one */ char_u *throw_msg; // msg to throw: usually original one
struct msglist *next; /* next of several messages in a row */ struct msglist *next; // next of several messages in a row
}; };
// The exception types. // The exception types.
@ -60,11 +60,11 @@ typedef enum
typedef struct vim_exception except_T; typedef struct vim_exception except_T;
struct vim_exception { struct vim_exception {
except_type_T type; // exception type except_type_T type; // exception type
char_u *value; // exception value char_u *value; // exception value
struct msglist *messages; // message(s) causing error exception struct msglist *messages; // message(s) causing error exception
char_u *throw_name; // name of the throw point char_u *throw_name; // name of the throw point
linenr_T throw_lnum; // line number of the throw point linenr_T throw_lnum; // line number of the throw point
except_T *caught; // next exception on the caught stack except_T *caught; // next exception on the caught stack
}; };
/* /*
@ -74,8 +74,8 @@ struct vim_exception {
*/ */
typedef struct cleanup_stuff cleanup_T; typedef struct cleanup_stuff cleanup_T;
struct cleanup_stuff { struct cleanup_stuff {
int pending; /* error/interrupt/exception state */ int pending; // error/interrupt/exception state
except_T *exception; /* exception value */ except_T *exception; // exception value
}; };
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS

View File

@ -7,7 +7,7 @@
#include "nvim/os/time.h" #include "nvim/os/time.h"
#include "nvim/regexp_defs.h" #include "nvim/regexp_defs.h"
/* Values for nextwild() and ExpandOne(). See ExpandOne() for meaning. */ // Values for nextwild() and ExpandOne(). See ExpandOne() for meaning.
#define WILD_FREE 1 #define WILD_FREE 1
#define WILD_EXPAND_FREE 2 #define WILD_EXPAND_FREE 2
#define WILD_EXPAND_KEEP 3 #define WILD_EXPAND_KEEP 3

View File

@ -1,10 +1,10 @@
#ifndef NVIM_EXTMARK_H #ifndef NVIM_EXTMARK_H
#define NVIM_EXTMARK_H #define NVIM_EXTMARK_H
#include "nvim/pos.h"
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/extmark_defs.h" #include "nvim/extmark_defs.h"
#include "nvim/marktree.h" #include "nvim/marktree.h"
#include "nvim/pos.h"
EXTERN int extmark_splice_pending INIT(= 0); EXTERN int extmark_splice_pending INIT(= 0);

View File

@ -1,8 +1,8 @@
#ifndef NVIM_EXTMARK_DEFS_H #ifndef NVIM_EXTMARK_DEFS_H
#define NVIM_EXTMARK_DEFS_H #define NVIM_EXTMARK_DEFS_H
#include "nvim/types.h"
#include "nvim/lib/kvec.h" #include "nvim/lib/kvec.h"
#include "nvim/types.h"
typedef struct Decoration Decoration; typedef struct Decoration Decoration;

View File

@ -1,15 +1,15 @@
#ifndef NVIM_FILE_SEARCH_H #ifndef NVIM_FILE_SEARCH_H
#define NVIM_FILE_SEARCH_H #define NVIM_FILE_SEARCH_H
#include <stdlib.h> // for size_t #include <stdlib.h> // for size_t
#include "nvim/types.h" // for char_u #include "nvim/globals.h" // for CdScope
#include "nvim/globals.h" // for CdScope #include "nvim/types.h" // for char_u
/* Flags for find_file_*() functions. */ // Flags for find_file_*() functions.
#define FINDFILE_FILE 0 /* only files */ #define FINDFILE_FILE 0 // only files
#define FINDFILE_DIR 1 /* only directories */ #define FINDFILE_DIR 1 // only directories
#define FINDFILE_BOTH 2 /* files and directories */ #define FINDFILE_BOTH 2 // files and directories
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "file_search.h.generated.h" # include "file_search.h.generated.h"

View File

@ -1,9 +1,9 @@
#ifndef NVIM_FILEIO_H #ifndef NVIM_FILEIO_H
#define NVIM_FILEIO_H #define NVIM_FILEIO_H
#include "nvim/autocmd.h"
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/os/os.h" #include "nvim/os/os.h"
#include "nvim/autocmd.h"
// Values for readfile() flags // Values for readfile() flags
#define READ_NEW 0x01 // read a file into a new buffer #define READ_NEW 0x01 // read a file into a new buffer

View File

@ -3,17 +3,17 @@
#include <stdio.h> #include <stdio.h>
#include "nvim/pos.h"
#include "nvim/garray.h"
#include "nvim/types.h"
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/garray.h"
#include "nvim/pos.h"
#include "nvim/types.h"
/* /*
* Info used to pass info about a fold from the fold-detection code to the * Info used to pass info about a fold from the fold-detection code to the
* code that displays the foldcolumn. * code that displays the foldcolumn.
*/ */
typedef struct foldinfo { typedef struct foldinfo {
linenr_T fi_lnum; /* line number where fold starts */ linenr_T fi_lnum; // line number where fold starts
int fi_level; /* level of the fold; when this is zero the int fi_level; /* level of the fold; when this is zero the
other fields are invalid */ other fields are invalid */
int fi_low_level; /* lowest fold level that starts in the same int fi_low_level; /* lowest fold level that starts in the same

View File

@ -1,24 +1,24 @@
// If DEFINE_FUNC_ATTRIBUTES macro is not defined then all function attributes // If DEFINE_FUNC_ATTRIBUTES macro is not defined then all function attributes
// are defined as empty values. // are defined as empty values.
// //
// If DO_NOT_DEFINE_EMPTY_ATTRIBUTES then empty macros are not defined. Thus // If DO_NOT_DEFINE_EMPTY_ATTRIBUTES then empty macros are not defined. Thus
// undefined DEFINE_FUNC_ATTRIBUTES and defined DO_NOT_DEFINE_EMPTY_ATTRIBUTES // undefined DEFINE_FUNC_ATTRIBUTES and defined DO_NOT_DEFINE_EMPTY_ATTRIBUTES
// leaves file with untouched FUNC_ATTR_* macros. This variant is used for // leaves file with untouched FUNC_ATTR_* macros. This variant is used for
// scripts/gendeclarations.lua. // scripts/gendeclarations.lua.
// //
// Empty macros are used for *.c files. (undefined DEFINE_FUNC_ATTRIBUTES and // Empty macros are used for *.c files. (undefined DEFINE_FUNC_ATTRIBUTES and
// undefined DO_NOT_DEFINE_EMPTY_ATTRIBUTES) // undefined DO_NOT_DEFINE_EMPTY_ATTRIBUTES)
// //
// Macros defined as __attribute__((*)) are used by generated header files. // Macros defined as __attribute__((*)) are used by generated header files.
// (defined DEFINE_FUNC_ATTRIBUTES and undefined // (defined DEFINE_FUNC_ATTRIBUTES and undefined
// DO_NOT_DEFINE_EMPTY_ATTRIBUTES) // DO_NOT_DEFINE_EMPTY_ATTRIBUTES)
// //
// Defined DEFINE_FUNC_ATTRIBUTES and defined DO_NOT_DEFINE_EMPTY_ATTRIBUTES is // Defined DEFINE_FUNC_ATTRIBUTES and defined DO_NOT_DEFINE_EMPTY_ATTRIBUTES is
// not used by anything. // not used by anything.
// FUNC_ATTR_* macros should be in *.c files for declarations generator. If you // FUNC_ATTR_* macros should be in *.c files for declarations generator. If you
// define a function for which declaration is not generated by // define a function for which declaration is not generated by
// gendeclarations.lua (e.g. template hash implementation) then you should use // gendeclarations.lua (e.g. template hash implementation) then you should use
// REAL_FATTR_* macros. // REAL_FATTR_* macros.
// gcc and clang expose their version as follows: // gcc and clang expose their version as follows:
@ -134,10 +134,10 @@
# if NVIM_HAS_ATTRIBUTE(no_sanitize_undefined) # if NVIM_HAS_ATTRIBUTE(no_sanitize_undefined)
# define REAL_FATTR_NO_SANITIZE_UNDEFINED \ # define REAL_FATTR_NO_SANITIZE_UNDEFINED \
__attribute__((no_sanitize_undefined)) __attribute__((no_sanitize_undefined))
# elif NVIM_HAS_ATTRIBUTE(no_sanitize) # elif NVIM_HAS_ATTRIBUTE(no_sanitize)
# define REAL_FATTR_NO_SANITIZE_UNDEFINED \ # define REAL_FATTR_NO_SANITIZE_UNDEFINED \
__attribute__((no_sanitize("undefined"))) __attribute__((no_sanitize("undefined")))
# endif # endif
# endif # endif

View File

@ -3,8 +3,8 @@
#include <stddef.h> // for size_t #include <stddef.h> // for size_t
#include "nvim/types.h" // for char_u
#include "nvim/log.h" #include "nvim/log.h"
#include "nvim/types.h" // for char_u
/// Structure used for growing arrays. /// Structure used for growing arrays.
/// This is used to store information that only grows, is deleted all at /// This is used to store information that only grows, is deleted all at
@ -68,6 +68,6 @@ static inline void *ga_append_via_ptr(garray_T *gap, size_t item_size)
/// garray. /// garray.
/// ///
/// @param gap the garray to be freed /// @param gap the garray to be freed
#define GA_DEEP_CLEAR_PTR(gap) GA_DEEP_CLEAR(gap, void*, FREE_PTR_PTR) #define GA_DEEP_CLEAR_PTR(gap) GA_DEEP_CLEAR(gap, void *, FREE_PTR_PTR)
#endif // NVIM_GARRAY_H #endif // NVIM_GARRAY_H

View File

@ -1,10 +1,10 @@
#ifndef NVIM_GETCHAR_H #ifndef NVIM_GETCHAR_H
#define NVIM_GETCHAR_H #define NVIM_GETCHAR_H
#include "nvim/os/fileio.h"
#include "nvim/types.h"
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/os/fileio.h"
#include "nvim/types.h"
#include "nvim/vim.h" #include "nvim/vim.h"
/// Values for "noremap" argument of ins_typebuf() /// Values for "noremap" argument of ins_typebuf()

View File

@ -1,23 +1,23 @@
#ifndef NVIM_GLOBALS_H #ifndef NVIM_GLOBALS_H
#define NVIM_GLOBALS_H #define NVIM_GLOBALS_H
#include <stdbool.h>
#include <inttypes.h> #include <inttypes.h>
#include <stdbool.h>
#include "nvim/macros.h" #include "nvim/event/loop.h"
#include "nvim/ex_eval.h" #include "nvim/ex_eval.h"
#include "nvim/iconv.h" #include "nvim/iconv.h"
#include "nvim/macros.h"
#include "nvim/mbyte.h" #include "nvim/mbyte.h"
#include "nvim/menu.h" #include "nvim/menu.h"
#include "nvim/os/os_defs.h"
#include "nvim/syntax_defs.h" #include "nvim/syntax_defs.h"
#include "nvim/types.h" #include "nvim/types.h"
#include "nvim/event/loop.h"
#include "nvim/os/os_defs.h"
#define IOSIZE (1024+1) // file I/O and sprintf buffer size #define IOSIZE (1024+1) // file I/O and sprintf buffer size
# define MSG_BUF_LEN 480 // length of buffer for small messages #define MSG_BUF_LEN 480 // length of buffer for small messages
# define MSG_BUF_CLEN (MSG_BUF_LEN / 6) // cell length (worst case: utf-8 #define MSG_BUF_CLEN (MSG_BUF_LEN / 6) // cell length (worst case: utf-8
// takes 6 bytes for one cell) // takes 6 bytes for one cell)
#ifdef WIN32 #ifdef WIN32
@ -169,16 +169,16 @@ EXTERN bool compl_busy INIT(= false);
// List of flags for method of completion. // List of flags for method of completion.
EXTERN int compl_cont_status INIT(= 0); EXTERN int compl_cont_status INIT(= 0);
# define CONT_ADDING 1 // "normal" or "adding" expansion #define CONT_ADDING 1 // "normal" or "adding" expansion
# define CONT_INTRPT (2 + 4) // a ^X interrupted the current expansion #define CONT_INTRPT (2 + 4) // a ^X interrupted the current expansion
// it's set only iff N_ADDS is set // it's set only iff N_ADDS is set
# define CONT_N_ADDS 4 // next ^X<> will add-new or expand-current #define CONT_N_ADDS 4 // next ^X<> will add-new or expand-current
# define CONT_S_IPOS 8 // next ^X<> will set initial_pos? #define CONT_S_IPOS 8 // next ^X<> will set initial_pos?
// if so, word-wise-expansion will set SOL // if so, word-wise-expansion will set SOL
# define CONT_SOL 16 // pattern includes start of line, just for #define CONT_SOL 16 // pattern includes start of line, just for
// word-wise expansion, not set for ^X^L // word-wise expansion, not set for ^X^L
# define CONT_LOCAL 32 // for ctrl_x_mode 0, ^X^P/^X^N do a local #define CONT_LOCAL 32 // for ctrl_x_mode 0, ^X^P/^X^N do a local
// expansion, (eg use complete=.) // expansion, (eg use complete=.)
EXTERN char_u *edit_submode INIT(= NULL); // msg for CTRL-X submode EXTERN char_u *edit_submode INIT(= NULL); // msg for CTRL-X submode
EXTERN char_u *edit_submode_pre INIT(= NULL); // prepended to edit_submode EXTERN char_u *edit_submode_pre INIT(= NULL); // prepended to edit_submode
@ -405,7 +405,7 @@ EXTERN int mouse_dragging INIT(= 0); // extending Visual area with
// mouse dragging // mouse dragging
// The root of the menu hierarchy. // The root of the menu hierarchy.
EXTERN vimmenu_T *root_menu INIT(= NULL); EXTERN vimmenu_T *root_menu INIT(= NULL);
// While defining the system menu, sys_menu is true. This avoids // While defining the system menu, sys_menu is true. This avoids
// overruling of menus that the user already defined. // overruling of menus that the user already defined.
EXTERN int sys_menu INIT(= false); EXTERN int sys_menu INIT(= false);
@ -417,48 +417,48 @@ EXTERN int updating_screen INIT(= 0);
// All windows are linked in a list. firstwin points to the first entry, // All windows are linked in a list. firstwin points to the first entry,
// lastwin to the last entry (can be the same as firstwin) and curwin to the // lastwin to the last entry (can be the same as firstwin) and curwin to the
// currently active window. // currently active window.
EXTERN win_T *firstwin; // first window EXTERN win_T *firstwin; // first window
EXTERN win_T *lastwin; // last window EXTERN win_T *lastwin; // last window
EXTERN win_T *prevwin INIT(= NULL); // previous window EXTERN win_T *prevwin INIT(= NULL); // previous window
# define ONE_WINDOW (firstwin == lastwin) #define ONE_WINDOW (firstwin == lastwin)
# define FOR_ALL_FRAMES(frp, first_frame) \ #define FOR_ALL_FRAMES(frp, first_frame) \
for (frp = first_frame; frp != NULL; frp = frp->fr_next) // NOLINT for (frp = first_frame; frp != NULL; frp = frp->fr_next) // NOLINT
// When using this macro "break" only breaks out of the inner loop. Use "goto" // When using this macro "break" only breaks out of the inner loop. Use "goto"
// to break out of the tabpage loop. // to break out of the tabpage loop.
# define FOR_ALL_TAB_WINDOWS(tp, wp) \ #define FOR_ALL_TAB_WINDOWS(tp, wp) \
FOR_ALL_TABS(tp) \ FOR_ALL_TABS(tp) \
FOR_ALL_WINDOWS_IN_TAB(wp, tp) FOR_ALL_WINDOWS_IN_TAB(wp, tp)
// -V:FOR_ALL_WINDOWS_IN_TAB:501 // -V:FOR_ALL_WINDOWS_IN_TAB:501
# define FOR_ALL_WINDOWS_IN_TAB(wp, tp) \ #define FOR_ALL_WINDOWS_IN_TAB(wp, tp) \
for (win_T *wp = ((tp) == curtab) \ for (win_T *wp = ((tp) == curtab) \
? firstwin : (tp)->tp_firstwin; wp != NULL; wp = wp->w_next) ? firstwin : (tp)->tp_firstwin; wp != NULL; wp = wp->w_next)
EXTERN win_T *curwin; // currently active window EXTERN win_T *curwin; // currently active window
EXTERN win_T *aucmd_win; // window used in aucmd_prepbuf() EXTERN win_T *aucmd_win; // window used in aucmd_prepbuf()
EXTERN int aucmd_win_used INIT(= false); // aucmd_win is being used EXTERN int aucmd_win_used INIT(= false); // aucmd_win is being used
// The window layout is kept in a tree of frames. topframe points to the top // The window layout is kept in a tree of frames. topframe points to the top
// of the tree. // of the tree.
EXTERN frame_T *topframe; // top of the window frame tree EXTERN frame_T *topframe; // top of the window frame tree
// Tab pages are alternative topframes. "first_tabpage" points to the first // Tab pages are alternative topframes. "first_tabpage" points to the first
// one in the list, "curtab" is the current one. // one in the list, "curtab" is the current one.
EXTERN tabpage_T *first_tabpage; EXTERN tabpage_T *first_tabpage;
EXTERN tabpage_T *lastused_tabpage; EXTERN tabpage_T *lastused_tabpage;
EXTERN tabpage_T *curtab; EXTERN tabpage_T *curtab;
EXTERN bool redraw_tabline INIT(= false); // need to redraw tabline EXTERN bool redraw_tabline INIT(= false); // need to redraw tabline
// Iterates over all tabs in the tab list // Iterates over all tabs in the tab list
# define FOR_ALL_TABS(tp) for (tabpage_T *tp = first_tabpage; tp != NULL; tp = tp->tp_next) #define FOR_ALL_TABS(tp) for (tabpage_T *tp = first_tabpage; tp != NULL; tp = tp->tp_next)
// All buffers are linked in a list. 'firstbuf' points to the first entry, // All buffers are linked in a list. 'firstbuf' points to the first entry,
// 'lastbuf' to the last entry and 'curbuf' to the currently active buffer. // 'lastbuf' to the last entry and 'curbuf' to the currently active buffer.
EXTERN buf_T *firstbuf INIT(= NULL); // first buffer EXTERN buf_T *firstbuf INIT(= NULL); // first buffer
EXTERN buf_T *lastbuf INIT(= NULL); // last buffer EXTERN buf_T *lastbuf INIT(= NULL); // last buffer
EXTERN buf_T *curbuf INIT(= NULL); // currently active buffer EXTERN buf_T *curbuf INIT(= NULL); // currently active buffer
// Iterates over all buffers in the buffer list. // Iterates over all buffers in the buffer list.
#define FOR_ALL_BUFFERS(buf) \ #define FOR_ALL_BUFFERS(buf) \
@ -593,16 +593,16 @@ EXTERN int inhibit_delete_count INIT(= 0);
// These flags are set based upon 'fileencoding'. // These flags are set based upon 'fileencoding'.
// The characters are internally stored as UTF-8 // The characters are internally stored as UTF-8
// to avoid trouble with NUL bytes. // to avoid trouble with NUL bytes.
# define DBCS_JPN 932 // japan #define DBCS_JPN 932 // japan
# define DBCS_JPNU 9932 // euc-jp #define DBCS_JPNU 9932 // euc-jp
# define DBCS_KOR 949 // korea #define DBCS_KOR 949 // korea
# define DBCS_KORU 9949 // euc-kr #define DBCS_KORU 9949 // euc-kr
# define DBCS_CHS 936 // chinese #define DBCS_CHS 936 // chinese
# define DBCS_CHSU 9936 // euc-cn #define DBCS_CHSU 9936 // euc-cn
# define DBCS_CHT 950 // taiwan #define DBCS_CHT 950 // taiwan
# define DBCS_CHTU 9950 // euc-tw #define DBCS_CHTU 9950 // euc-tw
# define DBCS_2BYTE 1 // 2byte- #define DBCS_2BYTE 1 // 2byte-
# define DBCS_DEBUG -1 #define DBCS_DEBUG -1
/// Encoding used when 'fencs' is set to "default" /// Encoding used when 'fencs' is set to "default"
EXTERN char_u *fenc_default INIT(= NULL); EXTERN char_u *fenc_default INIT(= NULL);
@ -672,9 +672,9 @@ EXTERN char_u NameBuff[MAXPATHL]; ///< Buffer for expanding file names
EXTERN char_u msg_buf[MSG_BUF_LEN]; ///< Small buffer for messages EXTERN char_u msg_buf[MSG_BUF_LEN]; ///< Small buffer for messages
EXTERN char os_buf[ ///< Buffer for the os/ layer EXTERN char os_buf[ ///< Buffer for the os/ layer
#if MAXPATHL > IOSIZE #if MAXPATHL > IOSIZE
MAXPATHL MAXPATHL
#else #else
IOSIZE IOSIZE
#endif #endif
]; ];
@ -746,7 +746,7 @@ EXTERN bool g_tag_at_cursor INIT(= false); // whether the tag command comes
EXTERN int replace_offset INIT(= 0); // offset for replace_push() EXTERN int replace_offset INIT(= 0); // offset for replace_push()
EXTERN char_u *escape_chars INIT(= (char_u *)" \t\\\"|"); EXTERN char_u *escape_chars INIT(= (char_u *)" \t\\\"|");
// need backslash in cmd line // need backslash in cmd line
EXTERN int keep_help_flag INIT(= false); // doing :ta from help file EXTERN int keep_help_flag INIT(= false); // doing :ta from help file
@ -754,7 +754,7 @@ EXTERN int keep_help_flag INIT(= false); // doing :ta from help file
// When a string option is NULL (which only happens in out-of-memory // When a string option is NULL (which only happens in out-of-memory
// situations), it is set to empty_option, to avoid having to check for NULL // situations), it is set to empty_option, to avoid having to check for NULL
// everywhere. // everywhere.
EXTERN char_u *empty_option INIT(= (char_u *)""); EXTERN char_u *empty_option INIT(= (char_u *)"");
EXTERN bool redir_off INIT(= false); // no redirection for a moment EXTERN bool redir_off INIT(= false); // no redirection for a moment
EXTERN FILE *redir_fd INIT(= NULL); // message redirection file EXTERN FILE *redir_fd INIT(= NULL); // message redirection file
@ -787,7 +787,7 @@ extern char_u *compiled_sys;
// When a window has a local directory, the absolute path of the global // When a window has a local directory, the absolute path of the global
// current directory is stored here (in allocated memory). If the current // current directory is stored here (in allocated memory). If the current
// directory is not a local directory, globaldir is NULL. // directory is not a local directory, globaldir is NULL.
EXTERN char_u *globaldir INIT(= NULL); EXTERN char_u *globaldir INIT(= NULL);
// Whether 'keymodel' contains "stopsel" and "startsel". // Whether 'keymodel' contains "stopsel" and "startsel".
EXTERN bool km_stopsel INIT(= false); EXTERN bool km_stopsel INIT(= false);
@ -810,8 +810,8 @@ EXTERN linenr_T sub_nlines; // total number of lines changed
EXTERN char_u wim_flags[4]; EXTERN char_u wim_flags[4];
// whether titlestring and iconstring contains statusline syntax // whether titlestring and iconstring contains statusline syntax
# define STL_IN_ICON 1 #define STL_IN_ICON 1
# define STL_IN_TITLE 2 #define STL_IN_TITLE 2
EXTERN int stl_syntax INIT(= 0); EXTERN int stl_syntax INIT(= 0);
// don't use 'hlsearch' temporarily // don't use 'hlsearch' temporarily
@ -846,15 +846,16 @@ EXTERN linenr_T spell_redraw_lnum INIT(= 0);
// The error messages that can be shared are included here. // The error messages that can be shared are included here.
// Excluded are errors that are only used once and debugging messages. // Excluded are errors that are only used once and debugging messages.
EXTERN char_u e_abort[] INIT(= N_("E470: Command aborted")); EXTERN char_u e_abort[] INIT(= N_("E470: Command aborted"));
EXTERN char_u e_afterinit[] INIT(= N_( EXTERN char_u e_afterinit[] INIT(= N_("E905: Cannot set this option after startup"));
"E905: Cannot set this option after startup"));
EXTERN char_u e_api_spawn_failed[] INIT(= N_("E903: Could not spawn API job")); EXTERN char_u e_api_spawn_failed[] INIT(= N_("E903: Could not spawn API job"));
EXTERN char_u e_argreq[] INIT(= N_("E471: Argument required")); EXTERN char_u e_argreq[] INIT(= N_("E471: Argument required"));
EXTERN char_u e_backslash[] INIT(= N_("E10: \\ should be followed by /, ? or &")); EXTERN char_u e_backslash[] INIT(= N_("E10: \\ should be followed by /, ? or &"));
EXTERN char_u e_cmdwin[] INIT(= N_( EXTERN char_u e_cmdwin[] INIT(=
"E11: Invalid in command-line window; <CR> executes, CTRL-C quits")); N_(
EXTERN char_u e_curdir[] INIT(= N_( "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"));
"E12: Command not allowed from exrc/vimrc in current dir or tag search")); EXTERN char_u e_curdir[] INIT(=
N_(
"E12: Command not allowed from exrc/vimrc in current dir or tag search"));
EXTERN char_u e_endif[] INIT(= N_("E171: Missing :endif")); EXTERN char_u e_endif[] INIT(= N_("E171: Missing :endif"));
EXTERN char_u e_endtry[] INIT(= N_("E600: Missing :endtry")); EXTERN char_u e_endtry[] INIT(= N_("E600: Missing :endtry"));
EXTERN char_u e_endwhile[] INIT(= N_("E170: Missing :endwhile")); EXTERN char_u e_endwhile[] INIT(= N_("E170: Missing :endwhile"));
@ -869,8 +870,7 @@ EXTERN char_u e_interr[] INIT(= N_("Interrupted"));
EXTERN char_u e_invarg[] INIT(= N_("E474: Invalid argument")); EXTERN char_u e_invarg[] INIT(= N_("E474: Invalid argument"));
EXTERN char_u e_invarg2[] INIT(= N_("E475: Invalid argument: %s")); EXTERN char_u e_invarg2[] INIT(= N_("E475: Invalid argument: %s"));
EXTERN char_u e_invargval[] INIT(= N_("E475: Invalid value for argument %s")); EXTERN char_u e_invargval[] INIT(= N_("E475: Invalid value for argument %s"));
EXTERN char_u e_invargNval[] INIT(= N_( EXTERN char_u e_invargNval[] INIT(= N_("E475: Invalid value for argument %s: %s"));
"E475: Invalid value for argument %s: %s"));
EXTERN char_u e_duparg2[] INIT(= N_("E983: Duplicate argument: %s")); EXTERN char_u e_duparg2[] INIT(= N_("E983: Duplicate argument: %s"));
EXTERN char_u e_invexpr2[] INIT(= N_("E15: Invalid expression: %s")); EXTERN char_u e_invexpr2[] INIT(= N_("E15: Invalid expression: %s"));
EXTERN char_u e_invrange[] INIT(= N_("E16: Invalid range")); EXTERN char_u e_invrange[] INIT(= N_("E16: Invalid range"));
@ -880,24 +880,21 @@ EXTERN char_u e_no_spell[] INIT(= N_("E756: Spell checking is not possible"));
EXTERN char_u e_invchan[] INIT(= N_("E900: Invalid channel id")); EXTERN char_u e_invchan[] INIT(= N_("E900: Invalid channel id"));
EXTERN char_u e_invchanjob[] INIT(= N_("E900: Invalid channel id: not a job")); EXTERN char_u e_invchanjob[] INIT(= N_("E900: Invalid channel id: not a job"));
EXTERN char_u e_jobtblfull[] INIT(= N_("E901: Job table is full")); EXTERN char_u e_jobtblfull[] INIT(= N_("E901: Job table is full"));
EXTERN char_u e_jobspawn[] INIT(= N_( EXTERN char_u e_jobspawn[] INIT(= N_("E903: Process failed to start: %s: \"%s\""));
"E903: Process failed to start: %s: \"%s\""));
EXTERN char_u e_channotpty[] INIT(= N_("E904: channel is not a pty")); EXTERN char_u e_channotpty[] INIT(= N_("E904: channel is not a pty"));
EXTERN char_u e_stdiochan2[] INIT(= N_( EXTERN char_u e_stdiochan2[] INIT(= N_("E905: Couldn't open stdio channel: %s"));
"E905: Couldn't open stdio channel: %s"));
EXTERN char_u e_invstream[] INIT(= N_("E906: invalid stream for channel")); EXTERN char_u e_invstream[] INIT(= N_("E906: invalid stream for channel"));
EXTERN char_u e_invstreamrpc[] INIT(= N_( EXTERN char_u e_invstreamrpc[] INIT(= N_("E906: invalid stream for rpc channel, use 'rpc'"));
"E906: invalid stream for rpc channel, use 'rpc'")); EXTERN char_u e_streamkey[] INIT(=
EXTERN char_u e_streamkey[] INIT(= N_( N_(
"E5210: dict key '%s' already set for buffered stream in channel %" "E5210: dict key '%s' already set for buffered stream in channel %"
PRIu64)); PRIu64));
EXTERN char_u e_libcall[] INIT(= N_("E364: Library call failed for \"%s()\"")); EXTERN char_u e_libcall[] INIT(= N_("E364: Library call failed for \"%s()\""));
EXTERN char e_fsync[] INIT(= N_("E667: Fsync failed: %s")); EXTERN char e_fsync[] INIT(= N_("E667: Fsync failed: %s"));
EXTERN char_u e_mkdir[] INIT(= N_("E739: Cannot create directory %s: %s")); EXTERN char_u e_mkdir[] INIT(= N_("E739: Cannot create directory %s: %s"));
EXTERN char_u e_markinval[] INIT(= N_("E19: Mark has invalid line number")); EXTERN char_u e_markinval[] INIT(= N_("E19: Mark has invalid line number"));
EXTERN char_u e_marknotset[] INIT(= N_("E20: Mark not set")); EXTERN char_u e_marknotset[] INIT(= N_("E20: Mark not set"));
EXTERN char_u e_modifiable[] INIT(= N_( EXTERN char_u e_modifiable[] INIT(= N_("E21: Cannot make changes, 'modifiable' is off"));
"E21: Cannot make changes, 'modifiable' is off"));
EXTERN char_u e_nesting[] INIT(= N_("E22: Scripts nested too deep")); EXTERN char_u e_nesting[] INIT(= N_("E22: Scripts nested too deep"));
EXTERN char_u e_noalt[] INIT(= N_("E23: No alternate file")); EXTERN char_u e_noalt[] INIT(= N_("E23: No alternate file"));
EXTERN char_u e_noabbr[] INIT(= N_("E24: No such abbreviation")); EXTERN char_u e_noabbr[] INIT(= N_("E24: No such abbreviation"));
@ -909,8 +906,7 @@ EXTERN char_u e_nomap[] INIT(= N_("E31: No such mapping"));
EXTERN char_u e_nomatch[] INIT(= N_("E479: No match")); EXTERN char_u e_nomatch[] INIT(= N_("E479: No match"));
EXTERN char_u e_nomatch2[] INIT(= N_("E480: No match: %s")); EXTERN char_u e_nomatch2[] INIT(= N_("E480: No match: %s"));
EXTERN char_u e_noname[] INIT(= N_("E32: No file name")); EXTERN char_u e_noname[] INIT(= N_("E32: No file name"));
EXTERN char_u e_nopresub[] INIT(= N_( EXTERN char_u e_nopresub[] INIT(= N_("E33: No previous substitute regular expression"));
"E33: No previous substitute regular expression"));
EXTERN char_u e_noprev[] INIT(= N_("E34: No previous command")); EXTERN char_u e_noprev[] INIT(= N_("E34: No previous command"));
EXTERN char_u e_noprevre[] INIT(= N_("E35: No previous regular expression")); EXTERN char_u e_noprevre[] INIT(= N_("E35: No previous regular expression"));
EXTERN char_u e_norange[] INIT(= N_("E481: No range allowed")); EXTERN char_u e_norange[] INIT(= N_("E481: No range allowed"));
@ -926,36 +922,30 @@ EXTERN char_u e_outofmem[] INIT(= N_("E41: Out of memory!"));
EXTERN char_u e_patnotf[] INIT(= N_("Pattern not found")); EXTERN char_u e_patnotf[] INIT(= N_("Pattern not found"));
EXTERN char_u e_patnotf2[] INIT(= N_("E486: Pattern not found: %s")); EXTERN char_u e_patnotf2[] INIT(= N_("E486: Pattern not found: %s"));
EXTERN char_u e_positive[] INIT(= N_("E487: Argument must be positive")); EXTERN char_u e_positive[] INIT(= N_("E487: Argument must be positive"));
EXTERN char_u e_prev_dir[] INIT(= N_( EXTERN char_u e_prev_dir[] INIT(= N_("E459: Cannot go back to previous directory"));
"E459: Cannot go back to previous directory"));
EXTERN char_u e_quickfix[] INIT(= N_("E42: No Errors")); EXTERN char_u e_quickfix[] INIT(= N_("E42: No Errors"));
EXTERN char_u e_loclist[] INIT(= N_("E776: No location list")); EXTERN char_u e_loclist[] INIT(= N_("E776: No location list"));
EXTERN char_u e_re_damg[] INIT(= N_("E43: Damaged match string")); EXTERN char_u e_re_damg[] INIT(= N_("E43: Damaged match string"));
EXTERN char_u e_re_corr[] INIT(= N_("E44: Corrupted regexp program")); EXTERN char_u e_re_corr[] INIT(= N_("E44: Corrupted regexp program"));
EXTERN char_u e_readonly[] INIT(= N_( EXTERN char_u e_readonly[] INIT(= N_("E45: 'readonly' option is set (add ! to override)"));
"E45: 'readonly' option is set (add ! to override)")); EXTERN char_u e_readonlyvar[] INIT(= N_("E46: Cannot change read-only variable \"%.*s\""));
EXTERN char_u e_readonlyvar[] INIT(= N_(
"E46: Cannot change read-only variable \"%.*s\""));
EXTERN char_u e_stringreq[] INIT(= N_("E928: String required")); EXTERN char_u e_stringreq[] INIT(= N_("E928: String required"));
EXTERN char_u e_dictreq[] INIT(= N_("E715: Dictionary required")); EXTERN char_u e_dictreq[] INIT(= N_("E715: Dictionary required"));
EXTERN char_u e_blobidx[] INIT(= N_("E979: Blob index out of range: %" PRId64)); EXTERN char_u e_blobidx[] INIT(= N_("E979: Blob index out of range: %" PRId64));
EXTERN char_u e_invalblob[] INIT(= N_("E978: Invalid operation for Blob")); EXTERN char_u e_invalblob[] INIT(= N_("E978: Invalid operation for Blob"));
EXTERN char_u e_toomanyarg[] INIT(= N_( EXTERN char_u e_toomanyarg[] INIT(= N_("E118: Too many arguments for function: %s"));
"E118: Too many arguments for function: %s")); EXTERN char_u e_dictkey[] INIT(= N_("E716: Key not present in Dictionary: \"%s\""));
EXTERN char_u e_dictkey[] INIT(= N_(
"E716: Key not present in Dictionary: \"%s\""));
EXTERN char_u e_listreq[] INIT(= N_("E714: List required")); EXTERN char_u e_listreq[] INIT(= N_("E714: List required"));
EXTERN char_u e_listblobreq[] INIT(= N_("E897: List or Blob required")); EXTERN char_u e_listblobreq[] INIT(= N_("E897: List or Blob required"));
EXTERN char_u e_listdictarg[] INIT(= N_( EXTERN char_u e_listdictarg[] INIT(= N_("E712: Argument of %s must be a List or Dictionary"));
"E712: Argument of %s must be a List or Dictionary")); EXTERN char_u e_listdictblobarg[] INIT(=
EXTERN char_u e_listdictblobarg[] INIT(= N_( N_(
"E896: Argument of %s must be a List, Dictionary or Blob")); "E896: Argument of %s must be a List, Dictionary or Blob"));
EXTERN char_u e_readerrf[] INIT(= N_("E47: Error while reading errorfile")); EXTERN char_u e_readerrf[] INIT(= N_("E47: Error while reading errorfile"));
EXTERN char_u e_sandbox[] INIT(= N_("E48: Not allowed in sandbox")); EXTERN char_u e_sandbox[] INIT(= N_("E48: Not allowed in sandbox"));
EXTERN char_u e_secure[] INIT(= N_("E523: Not allowed here")); EXTERN char_u e_secure[] INIT(= N_("E523: Not allowed here"));
EXTERN char_u e_screenmode[] INIT(= N_( EXTERN char_u e_screenmode[] INIT(= N_("E359: Screen mode setting not supported"));
"E359: Screen mode setting not supported"));
EXTERN char_u e_scroll[] INIT(= N_("E49: Invalid scroll size")); EXTERN char_u e_scroll[] INIT(= N_("E49: Invalid scroll size"));
EXTERN char_u e_shellempty[] INIT(= N_("E91: 'shell' option is empty")); EXTERN char_u e_shellempty[] INIT(= N_("E91: 'shell' option is empty"));
EXTERN char_u e_signdata[] INIT(= N_("E255: Couldn't read in sign data!")); EXTERN char_u e_signdata[] INIT(= N_("E255: Couldn't read in sign data!"));
@ -969,57 +959,45 @@ EXTERN char_u e_trailing[] INIT(= N_("E488: Trailing characters"));
EXTERN char_u e_trailing2[] INIT(= N_("E488: Trailing characters: %s")); EXTERN char_u e_trailing2[] INIT(= N_("E488: Trailing characters: %s"));
EXTERN char_u e_umark[] INIT(= N_("E78: Unknown mark")); EXTERN char_u e_umark[] INIT(= N_("E78: Unknown mark"));
EXTERN char_u e_wildexpand[] INIT(= N_("E79: Cannot expand wildcards")); EXTERN char_u e_wildexpand[] INIT(= N_("E79: Cannot expand wildcards"));
EXTERN char_u e_winheight[] INIT(= N_( EXTERN char_u e_winheight[] INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'"));
"E591: 'winheight' cannot be smaller than 'winminheight'")); EXTERN char_u e_winwidth[] INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
EXTERN char_u e_winwidth[] INIT(= N_(
"E592: 'winwidth' cannot be smaller than 'winminwidth'"));
EXTERN char_u e_write[] INIT(= N_("E80: Error while writing")); EXTERN char_u e_write[] INIT(= N_("E80: Error while writing"));
EXTERN char_u e_zerocount[] INIT(= N_("E939: Positive count required")); EXTERN char_u e_zerocount[] INIT(= N_("E939: Positive count required"));
EXTERN char_u e_usingsid[] INIT(= N_( EXTERN char_u e_usingsid[] INIT(= N_("E81: Using <SID> not in a script context"));
"E81: Using <SID> not in a script context"));
EXTERN char_u e_missingparen[] INIT(= N_("E107: Missing parentheses: %s")); EXTERN char_u e_missingparen[] INIT(= N_("E107: Missing parentheses: %s"));
EXTERN char_u e_maxmempat[] INIT(= N_( EXTERN char_u e_maxmempat[] INIT(= N_("E363: pattern uses more memory than 'maxmempattern'"));
"E363: pattern uses more memory than 'maxmempattern'"));
EXTERN char_u e_emptybuf[] INIT(= N_("E749: empty buffer")); EXTERN char_u e_emptybuf[] INIT(= N_("E749: empty buffer"));
EXTERN char_u e_nobufnr[] INIT(= N_("E86: Buffer %" PRId64 " does not exist")); EXTERN char_u e_nobufnr[] INIT(= N_("E86: Buffer %" PRId64 " does not exist"));
EXTERN char_u e_invalpat[] INIT(= N_( EXTERN char_u e_invalpat[] INIT(= N_("E682: Invalid search pattern or delimiter"));
"E682: Invalid search pattern or delimiter"));
EXTERN char_u e_bufloaded[] INIT(= N_("E139: File is loaded in another buffer")); EXTERN char_u e_bufloaded[] INIT(= N_("E139: File is loaded in another buffer"));
EXTERN char_u e_notset[] INIT(= N_("E764: Option '%s' is not set")); EXTERN char_u e_notset[] INIT(= N_("E764: Option '%s' is not set"));
EXTERN char_u e_invalidreg[] INIT(= N_("E850: Invalid register name")); EXTERN char_u e_invalidreg[] INIT(= N_("E850: Invalid register name"));
EXTERN char_u e_dirnotf[] INIT(= N_( EXTERN char_u e_dirnotf[] INIT(= N_("E919: Directory not found in '%s': \"%s\""));
"E919: Directory not found in '%s': \"%s\"")); EXTERN char_u e_au_recursive[] INIT(= N_("E952: Autocommand caused recursive behavior"));
EXTERN char_u e_au_recursive[] INIT(= N_( EXTERN char_u e_autocmd_close[] INIT(= N_("E813: Cannot close autocmd window"));
"E952: Autocommand caused recursive behavior"));
EXTERN char_u e_autocmd_close[] INIT(= N_(
"E813: Cannot close autocmd window"));
EXTERN char_u e_unsupportedoption[] INIT(= N_("E519: Option not supported")); EXTERN char_u e_unsupportedoption[] INIT(= N_("E519: Option not supported"));
EXTERN char_u e_fnametoolong[] INIT(= N_("E856: Filename too long")); EXTERN char_u e_fnametoolong[] INIT(= N_("E856: Filename too long"));
EXTERN char_u e_float_as_string[] INIT(= N_("E806: using Float as a String")); EXTERN char_u e_float_as_string[] INIT(= N_("E806: using Float as a String"));
EXTERN char_u e_autocmd_err[] INIT(=N_( EXTERN char_u e_autocmd_err[] INIT(=N_("E5500: autocmd has thrown an exception: %s"));
"E5500: autocmd has thrown an exception: %s")); EXTERN char_u e_cmdmap_err[] INIT(=N_("E5520: <Cmd> mapping must end with <CR>"));
EXTERN char_u e_cmdmap_err[] INIT(=N_( EXTERN char_u e_cmdmap_repeated[] INIT(=
"E5520: <Cmd> mapping must end with <CR>")); N_(
EXTERN char_u e_cmdmap_repeated[] INIT(=N_( "E5521: <Cmd> mapping must end with <CR> before second <Cmd>"));
"E5521: <Cmd> mapping must end with <CR> before second <Cmd>")); EXTERN char_u e_cmdmap_key[] INIT(=N_("E5522: <Cmd> mapping must not include %s key"));
EXTERN char_u e_cmdmap_key[] INIT(=N_(
"E5522: <Cmd> mapping must not include %s key"));
EXTERN char_u e_api_error[] INIT(=N_( EXTERN char_u e_api_error[] INIT(=N_("E5555: API call: %s"));
"E5555: API call: %s"));
EXTERN char e_luv_api_disabled[] INIT(=N_( EXTERN char e_luv_api_disabled[] INIT(=N_("E5560: %s must not be called in a lua loop callback"));
"E5560: %s must not be called in a lua loop callback"));
EXTERN char_u e_floatonly[] INIT(=N_( EXTERN char_u e_floatonly[] INIT(=N_(
"E5601: Cannot close window, only floating window would remain")); "E5601: Cannot close window, only floating window would remain"));
EXTERN char_u e_floatexchange[] INIT(=N_( EXTERN char_u e_floatexchange[] INIT(=N_("E5602: Cannot exchange or rotate float"));
"E5602: Cannot exchange or rotate float"));
EXTERN char e_cannot_define_autocommands_for_all_events[] INIT(= N_( EXTERN char e_cannot_define_autocommands_for_all_events[] INIT(=
"E1155: Cannot define autocommands for ALL events")); N_(
"E1155: Cannot define autocommands for ALL events"));
EXTERN char top_bot_msg[] INIT(= N_("search hit TOP, continuing at BOTTOM")); EXTERN char top_bot_msg[] INIT(= N_("search hit TOP, continuing at BOTTOM"));
EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP")); EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP"));

View File

@ -48,10 +48,10 @@ typedef struct ScreenGrid ScreenGrid;
struct ScreenGrid { struct ScreenGrid {
handle_T handle; handle_T handle;
schar_T *chars; schar_T *chars;
sattr_T *attrs; sattr_T *attrs;
unsigned *line_offset; unsigned *line_offset;
char_u *line_wraps; char_u *line_wraps;
// last column that was drawn (not cleared with the default background). // last column that was drawn (not cleared with the default background).
// only used when "throttled" is set. Not allocated by grid_alloc! // only used when "throttled" is set. Not allocated by grid_alloc!

View File

@ -4,9 +4,9 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> // for size_t #include <stdlib.h> // for size_t
#include "nvim/ex_cmds_defs.h" // for exarg_T
#include "nvim/globals.h" // for TriState #include "nvim/globals.h" // for TriState
#include "nvim/types.h" // for char_u #include "nvim/types.h" // for char_u
#include "nvim/ex_cmds_defs.h" // for exarg_T
/* /*
* Structure to hold printing color and font attributes. * Structure to hold printing color and font attributes.
@ -34,19 +34,19 @@ typedef struct {
int modec; int modec;
int do_syntax; int do_syntax;
int user_abort; int user_abort;
char_u *jobname; char_u *jobname;
char_u *outfile; char_u *outfile;
char_u *arguments; char_u *arguments;
} prt_settings_T; } prt_settings_T;
/* /*
* Generic option table item, only used for printer at the moment. * Generic option table item, only used for printer at the moment.
*/ */
typedef struct { typedef struct {
const char *name; const char *name;
int hasnum; int hasnum;
int number; int number;
char_u *string; /* points into option string */ char_u *string; // points into option string
int strlen; int strlen;
int present; int present;
} option_table_T; } option_table_T;
@ -67,13 +67,13 @@ typedef struct {
#define OPT_PRINT_FORMFEED 13 #define OPT_PRINT_FORMFEED 13
#define OPT_PRINT_NUM_OPTIONS 14 #define OPT_PRINT_NUM_OPTIONS 14
/* For prt_get_unit(). */ // For prt_get_unit().
#define PRT_UNIT_NONE -1 #define PRT_UNIT_NONE -1
#define PRT_UNIT_PERC 0 #define PRT_UNIT_PERC 0
#define PRT_UNIT_INCH 1 #define PRT_UNIT_INCH 1
#define PRT_UNIT_MM 2 #define PRT_UNIT_MM 2
#define PRT_UNIT_POINT 3 #define PRT_UNIT_POINT 3
#define PRT_UNIT_NAMES {"pc", "in", "mm", "pt"} #define PRT_UNIT_NAMES { "pc", "in", "mm", "pt" }
#define PRINT_NUMBER_WIDTH 8 #define PRINT_NUMBER_WIDTH 8

View File

@ -77,18 +77,18 @@ typedef struct hashtable_S {
/// @param hi Name of the variable with current hashtab entry. /// @param hi Name of the variable with current hashtab entry.
/// @param code Cycle body. /// @param code Cycle body.
#define HASHTAB_ITER(ht, hi, code) \ #define HASHTAB_ITER(ht, hi, code) \
do { \ do { \
hashtab_T *const hi##ht_ = (ht); \ hashtab_T *const hi##ht_ = (ht); \
size_t hi##todo_ = hi##ht_->ht_used; \ size_t hi##todo_ = hi##ht_->ht_used; \
for (hashitem_T *hi = hi##ht_->ht_array; hi##todo_; hi++) { \ for (hashitem_T *hi = hi##ht_->ht_array; hi##todo_; hi++) { \
if (!HASHITEM_EMPTY(hi)) { \ if (!HASHITEM_EMPTY(hi)) { \
hi##todo_--; \ hi##todo_--; \
{ \ { \
code \ code \
} \
} \ } \
} \ } \
} while (0) } \
} while (0)
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "hashtab.h.generated.h" # include "hashtab.h.generated.h"

View File

@ -2,15 +2,16 @@
#define NVIM_HIGHLIGHT_H #define NVIM_HIGHLIGHT_H
#include <stdbool.h> #include <stdbool.h>
#include "nvim/highlight_defs.h"
#include "nvim/api/private/defs.h" #include "nvim/api/private/defs.h"
#include "nvim/highlight_defs.h"
#include "nvim/ui.h" #include "nvim/ui.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "highlight.h.generated.h" # include "highlight.h.generated.h"
#endif #endif
# define HL_SET_DEFAULT_COLORS(rgb_fg, rgb_bg, rgb_sp) \ #define HL_SET_DEFAULT_COLORS(rgb_fg, rgb_bg, rgb_sp) \
do { \ do { \
bool dark_ = (*p_bg == 'd'); \ bool dark_ = (*p_bg == 'd'); \
rgb_fg = rgb_fg != -1 ? rgb_fg : (dark_ ? 0xFFFFFF : 0x000000); \ rgb_fg = rgb_fg != -1 ? rgb_fg : (dark_ ? 0xFFFFFF : 0x000000); \

View File

@ -4,17 +4,17 @@
#include "auto/config.h" #include "auto/config.h"
#ifdef HAVE_ICONV #ifdef HAVE_ICONV
# include <errno.h> # include <errno.h>
# include <iconv.h> # include <iconv.h>
// define some missing constants if necessary // define some missing constants if necessary
# ifndef EILSEQ # ifndef EILSEQ
# define EILSEQ 123 # define EILSEQ 123
# endif # endif
# define ICONV_ERRNO errno # define ICONV_ERRNO errno
# define ICONV_E2BIG E2BIG # define ICONV_E2BIG E2BIG
# define ICONV_EINVAL EINVAL # define ICONV_EINVAL EINVAL
# define ICONV_EILSEQ EILSEQ # define ICONV_EILSEQ EILSEQ
#endif #endif
#endif // NVIM_ICONV_H #endif // NVIM_ICONV_H

View File

@ -1,8 +1,8 @@
#ifndef NVIM_IF_CSCOPE_H #ifndef NVIM_IF_CSCOPE_H
#define NVIM_IF_CSCOPE_H #define NVIM_IF_CSCOPE_H
#include "nvim/types.h" // for char_u and expand_T #include "nvim/ex_cmds_defs.h" // for exarg_T
#include "nvim/ex_cmds_defs.h" // for exarg_T #include "nvim/types.h" // for char_u and expand_T
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "if_cscope.h.generated.h" # include "if_cscope.h.generated.h"

View File

@ -13,9 +13,9 @@
# include <sys/types.h> // pid_t # include <sys/types.h> // pid_t
#endif #endif
#include "nvim/os/os_defs.h"
#include "nvim/os/fs_defs.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/os/fs_defs.h"
#include "nvim/os/os_defs.h"
#define CSCOPE_SUCCESS 0 #define CSCOPE_SUCCESS 0
#define CSCOPE_FAILURE -1 #define CSCOPE_FAILURE -1
@ -40,11 +40,11 @@ typedef struct csi {
#if defined(UNIX) #if defined(UNIX)
pid_t pid; // PID of the connected cscope process pid_t pid; // PID of the connected cscope process
#else #else
DWORD pid; // PID of the connected cscope process DWORD pid; // PID of the connected cscope process
HANDLE hProc; // cscope process handle HANDLE hProc; // cscope process handle
DWORD nVolume; // Volume serial number, instead of st_dev DWORD nVolume; // Volume serial number, instead of st_dev
DWORD nIndexHigh; // st_ino has no meaning on Windows DWORD nIndexHigh; // st_ino has no meaning on Windows
DWORD nIndexLow; DWORD nIndexLow;
#endif #endif
FileID file_id; FileID file_id;

View File

@ -1,6 +1,8 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check // This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// uncrustify:off
#include <assert.h> #include <assert.h>
#include <inttypes.h> #include <inttypes.h>

View File

@ -41,31 +41,31 @@
/* /*
* NUL cannot be in the input string, therefore it is replaced by * NUL cannot be in the input string, therefore it is replaced by
* K_SPECIAL KS_ZERO KE_FILLER * K_SPECIAL KS_ZERO KE_FILLER
*/ */
#define KS_ZERO 255 #define KS_ZERO 255
/* /*
* K_SPECIAL cannot be in the input string, therefore it is replaced by * K_SPECIAL cannot be in the input string, therefore it is replaced by
* K_SPECIAL KS_SPECIAL KE_FILLER * K_SPECIAL KS_SPECIAL KE_FILLER
*/ */
#define KS_SPECIAL 254 #define KS_SPECIAL 254
/* /*
* KS_EXTRA is used for keys that have no termcap name * KS_EXTRA is used for keys that have no termcap name
* K_SPECIAL KS_EXTRA KE_xxx * K_SPECIAL KS_EXTRA KE_xxx
*/ */
#define KS_EXTRA 253 #define KS_EXTRA 253
/* /*
* KS_MODIFIER is used when a modifier is given for a (special) key * KS_MODIFIER is used when a modifier is given for a (special) key
* K_SPECIAL KS_MODIFIER bitmask * K_SPECIAL KS_MODIFIER bitmask
*/ */
#define KS_MODIFIER 252 #define KS_MODIFIER 252
/* /*
* These are used for the GUI * These are used for the GUI
* K_SPECIAL KS_xxx KE_FILLER * K_SPECIAL KS_xxx KE_FILLER
*/ */
#define KS_MOUSE 251 #define KS_MOUSE 251
#define KS_MENU 250 #define KS_MENU 250
@ -170,8 +170,8 @@ enum key_extra {
, KE_MOUSE = 43 // mouse event start , KE_MOUSE = 43 // mouse event start
// Symbols for pseudo keys which are translated from the real key symbols // Symbols for pseudo keys which are translated from the real key symbols
// above. // above.
, KE_LEFTMOUSE = 44 // Left mouse button click , KE_LEFTMOUSE = 44 // Left mouse button click
, KE_LEFTDRAG = 45 // Drag with left mouse button down , KE_LEFTDRAG = 45 // Drag with left mouse button down
, KE_LEFTRELEASE = 46 // Left mouse button release , KE_LEFTRELEASE = 46 // Left mouse button release
@ -187,7 +187,7 @@ enum key_extra {
, KE_TAB = 54 // unshifted TAB key , KE_TAB = 54 // unshifted TAB key
, KE_S_TAB_OLD = 55 // shifted TAB key (no longer used) , KE_S_TAB_OLD = 55 // shifted TAB key (no longer used)
// , KE_SNIFF_UNUSED = 56 // obsolete // , KE_SNIFF_UNUSED = 56 // obsolete
, KE_XF1 = 57 // extra vt100 function keys for xterm , KE_XF1 = 57 // extra vt100 function keys for xterm
, KE_XF2 = 58 , KE_XF2 = 58
, KE_XF3 = 59 , KE_XF3 = 59
@ -209,9 +209,9 @@ enum key_extra {
, KE_S_XF3 = 73 , KE_S_XF3 = 73
, KE_S_XF4 = 74 , KE_S_XF4 = 74
// NOTE: The scroll wheel events are inverted: i.e. UP is the same as // NOTE: The scroll wheel events are inverted: i.e. UP is the same as
// moving the actual scroll wheel down, LEFT is the same as moving the // moving the actual scroll wheel down, LEFT is the same as moving the
// scroll wheel right. // scroll wheel right.
, KE_MOUSEDOWN = 75 // scroll wheel pseudo-button Down , KE_MOUSEDOWN = 75 // scroll wheel pseudo-button Down
, KE_MOUSEUP = 76 // scroll wheel pseudo-button Up , KE_MOUSEUP = 76 // scroll wheel pseudo-button Up
, KE_MOUSELEFT = 77 // scroll wheel pseudo-button Left , KE_MOUSELEFT = 77 // scroll wheel pseudo-button Left
@ -238,12 +238,12 @@ enum key_extra {
, KE_X2RELEASE = 94 , KE_X2RELEASE = 94
, KE_DROP = 95 // DnD data is available , KE_DROP = 95 // DnD data is available
// , KE_CURSORHOLD = 96 // CursorHold event // , KE_CURSORHOLD = 96 // CursorHold event
, KE_NOP = 97 // no-op: does nothing , KE_NOP = 97 // no-op: does nothing
// , KE_FOCUSGAINED = 98 // focus gained // , KE_FOCUSGAINED = 98 // focus gained
// , KE_FOCUSLOST = 99 // focus lost // , KE_FOCUSLOST = 99 // focus lost
, KE_MOUSEMOVE = 100 // mouse moved with no button down , KE_MOUSEMOVE = 100 // mouse moved with no button down
// , KE_CANCEL = 101 // return from vgetc // , KE_CANCEL = 101 // return from vgetc
, KE_EVENT = 102 // event , KE_EVENT = 102 // event
, KE_COMMAND = 104 // <Cmd> special key , KE_COMMAND = 104 // <Cmd> special key
}; };

View File

@ -1,3 +1,5 @@
// uncrustify:off
/*- /*-
* Copyright 1997-1999, 2001, John-Mark Gurney. * Copyright 1997-1999, 2001, John-Mark Gurney.
* 2008-2009, Attractive Chaos <attractor@live.co.uk> * 2008-2009, Attractive Chaos <attractor@live.co.uk>

View File

@ -1,3 +1,5 @@
// uncrustify:off
/* The MIT License /* The MIT License
Copyright (c) 2008, 2009, 2011 by Attractive Chaos <attractor@live.co.uk> Copyright (c) 2008, 2009, 2011 by Attractive Chaos <attractor@live.co.uk>

View File

@ -1,3 +1,5 @@
// uncrustify:off
/* The MIT License /* The MIT License
Copyright (c) 2008-2009, by Attractive Chaos <attractor@live.co.uk> Copyright (c) 2008-2009, by Attractive Chaos <attractor@live.co.uk>

View File

@ -1,3 +1,5 @@
// uncrustify:off
// The MIT License // The MIT License
// //
// Copyright (c) 2008, by Attractive Chaos <attractor@live.co.uk> // Copyright (c) 2008, by Attractive Chaos <attractor@live.co.uk>

View File

@ -1,3 +1,5 @@
// uncrustify:off
// Queue implemented by circularly-linked list. // Queue implemented by circularly-linked list.
// //
// Adapted from libuv. Simpler and more efficient than klist.h for implementing // Adapted from libuv. Simpler and more efficient than klist.h for implementing

View File

@ -1,3 +1,5 @@
// uncrustify:off
/// Macros-based ring buffer implementation. /// Macros-based ring buffer implementation.
/// ///
/// Supported functions: /// Supported functions:

View File

@ -1,8 +1,8 @@
#ifndef NVIM_LOG_H #ifndef NVIM_LOG_H
#define NVIM_LOG_H #define NVIM_LOG_H
#include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h>
#include "auto/config.h" #include "auto/config.h"
#include "nvim/macros.h" #include "nvim/macros.h"
@ -10,10 +10,10 @@
// USDT probes. Example invocation: // USDT probes. Example invocation:
// NVIM_PROBE(nvim_foo_bar, 1, string.data); // NVIM_PROBE(nvim_foo_bar, 1, string.data);
#if defined(HAVE_SYS_SDT_H) #if defined(HAVE_SYS_SDT_H)
#include <sys/sdt.h> // NOLINT # include <sys/sdt.h> // NOLINT
#define NVIM_PROBE(name, n, ...) STAP_PROBE##n(neovim, name, __VA_ARGS__) # define NVIM_PROBE(name, n, ...) STAP_PROBE##n(neovim, name, __VA_ARGS__)
#else #else
#define NVIM_PROBE(name, n, ...) # define NVIM_PROBE(name, n, ...)
#endif #endif
@ -33,7 +33,7 @@
#define ELOGN(...) #define ELOGN(...)
#ifndef MIN_LOG_LEVEL #ifndef MIN_LOG_LEVEL
# define MIN_LOG_LEVEL INFO_LOG_LEVEL # define MIN_LOG_LEVEL INFO_LOG_LEVEL
#endif #endif
#define LOG(level, ...) logmsg((level), NULL, __func__, __LINE__, true, \ #define LOG(level, ...) logmsg((level), NULL, __func__, __LINE__, true, \

View File

@ -43,15 +43,15 @@
#define TOLOWER_LOC tolower #define TOLOWER_LOC tolower
// toupper() and tolower() for ASCII only and ignore the current locale. // toupper() and tolower() for ASCII only and ignore the current locale.
# define TOUPPER_ASC(c) (((c) < 'a' || (c) > 'z') ? (c) : (c) - ('a' - 'A')) #define TOUPPER_ASC(c) (((c) < 'a' || (c) > 'z') ? (c) : (c) - ('a' - 'A'))
# define TOLOWER_ASC(c) (((c) < 'A' || (c) > 'Z') ? (c) : (c) + ('a' - 'A')) #define TOLOWER_ASC(c) (((c) < 'A' || (c) > 'Z') ? (c) : (c) + ('a' - 'A'))
// Like isalpha() but reject non-ASCII characters. Can't be used with a // Like isalpha() but reject non-ASCII characters. Can't be used with a
// special key (negative value). // special key (negative value).
# define ASCII_ISLOWER(c) ((unsigned)(c) >= 'a' && (unsigned)(c) <= 'z') #define ASCII_ISLOWER(c) ((unsigned)(c) >= 'a' && (unsigned)(c) <= 'z')
# define ASCII_ISUPPER(c) ((unsigned)(c) >= 'A' && (unsigned)(c) <= 'Z') #define ASCII_ISUPPER(c) ((unsigned)(c) >= 'A' && (unsigned)(c) <= 'Z')
# define ASCII_ISALPHA(c) (ASCII_ISUPPER(c) || ASCII_ISLOWER(c)) #define ASCII_ISALPHA(c) (ASCII_ISUPPER(c) || ASCII_ISLOWER(c))
# define ASCII_ISALNUM(c) (ASCII_ISALPHA(c) || ascii_isdigit(c)) #define ASCII_ISALNUM(c) (ASCII_ISALPHA(c) || ascii_isdigit(c))
// Returns empty string if it is NULL. // Returns empty string if it is NULL.
#define EMPTY_IF_NULL(x) ((x) ? (x) : (char_u *)"") #define EMPTY_IF_NULL(x) ((x) ? (x) : (char_u *)"")
@ -62,7 +62,7 @@
// Don't apply 'langmap' if the character comes from the Stuff buffer or from a // Don't apply 'langmap' if the character comes from the Stuff buffer or from a
// mapping and the langnoremap option was set. // mapping and the langnoremap option was set.
// The do-while is just to ignore a ';' after the macro. // The do-while is just to ignore a ';' after the macro.
# define LANGMAP_ADJUST(c, condition) \ #define LANGMAP_ADJUST(c, condition) \
do { \ do { \
if (*p_langmap \ if (*p_langmap \
&& (condition) \ && (condition) \
@ -71,9 +71,9 @@
&& (c) >= 0) \ && (c) >= 0) \
{ \ { \
if ((c) < 256) \ if ((c) < 256) \
c = langmap_mapchar[c]; \ c = langmap_mapchar[c]; \
else \ else \
c = langmap_adjust_mb(c); \ c = langmap_adjust_mb(c); \
} \ } \
} while (0) } while (0)
@ -90,9 +90,9 @@
# define mch_open_rw(n, f) os_open((n), (f), 0) # define mch_open_rw(n, f) os_open((n), (f), 0)
#endif #endif
# define REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG)) #define REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG))
# define UTF_COMPOSINGLIKE(p1, p2) utf_composinglike((p1), (p2)) #define UTF_COMPOSINGLIKE(p1, p2) utf_composinglike((p1), (p2))
// MB_PTR_ADV(): advance a pointer to the next character, taking care of // MB_PTR_ADV(): advance a pointer to the next character, taking care of
// multi-byte characters if needed. // multi-byte characters if needed.
@ -102,22 +102,22 @@
// PTR2CHAR(): get character from pointer. // PTR2CHAR(): get character from pointer.
// Advance multi-byte pointer, skip over composing chars. // Advance multi-byte pointer, skip over composing chars.
# define MB_PTR_ADV(p) (p += mb_ptr2len((char_u *)p)) #define MB_PTR_ADV(p) (p += mb_ptr2len((char_u *)p))
// Advance multi-byte pointer, do not skip over composing chars. // Advance multi-byte pointer, do not skip over composing chars.
# define MB_CPTR_ADV(p) (p += utf_ptr2len(p)) #define MB_CPTR_ADV(p) (p += utf_ptr2len(p))
// Backup multi-byte pointer. Only use with "p" > "s" ! // Backup multi-byte pointer. Only use with "p" > "s" !
# define MB_PTR_BACK(s, p) \ #define MB_PTR_BACK(s, p) \
(p -= utf_head_off((char_u *)s, (char_u *)p - 1) + 1) (p -= utf_head_off((char_u *)s, (char_u *)p - 1) + 1)
// get length of multi-byte char, not including composing chars // get length of multi-byte char, not including composing chars
# define MB_CPTR2LEN(p) utf_ptr2len(p) #define MB_CPTR2LEN(p) utf_ptr2len(p)
# define MB_COPY_CHAR(f, t) mb_copy_char((const char_u **)(&f), &t); #define MB_COPY_CHAR(f, t) mb_copy_char((const char_u **)(&f), &t);
# define MB_CHARLEN(p) mb_charlen(p) #define MB_CHARLEN(p) mb_charlen(p)
# define MB_CHAR2LEN(c) mb_char2len(c) #define MB_CHAR2LEN(c) mb_char2len(c)
# define PTR2CHAR(p) utf_ptr2char(p) #define PTR2CHAR(p) utf_ptr2char(p)
# define RESET_BINDING(wp) \ #define RESET_BINDING(wp) \
do { \ do { \
(wp)->w_p_scb = false; \ (wp)->w_p_scb = false; \
(wp)->w_p_crb = false; \ (wp)->w_p_crb = false; \
@ -132,8 +132,8 @@
/// ///
/// -V:ARRAY_SIZE:1063 /// -V:ARRAY_SIZE:1063
#define ARRAY_SIZE(arr) \ #define ARRAY_SIZE(arr) \
((sizeof(arr)/sizeof((arr)[0])) \ ((sizeof(arr)/sizeof((arr)[0])) \
/ ((size_t)(!(sizeof(arr) % sizeof((arr)[0]))))) / ((size_t)(!(sizeof(arr) % sizeof((arr)[0])))))
/// Get last array entry /// Get last array entry
/// ///
@ -156,7 +156,7 @@
#ifndef __has_attribute #ifndef __has_attribute
# define NVIM_HAS_ATTRIBUTE(x) 0 # define NVIM_HAS_ATTRIBUTE(x) 0
#elif defined(__clang__) && __clang__ == 1 \ #elif defined(__clang__) && __clang__ == 1 \
&& (__clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ <= 5)) && (__clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ <= 5))
// Starting in Clang 3.6, __has_attribute was fixed to only report true for // Starting in Clang 3.6, __has_attribute was fixed to only report true for
// GNU-style attributes. Prior to that, it reported true if _any_ backend // GNU-style attributes. Prior to that, it reported true if _any_ backend
// supported the attribute. // supported the attribute.
@ -166,7 +166,7 @@
#endif #endif
#if NVIM_HAS_ATTRIBUTE(fallthrough) \ #if NVIM_HAS_ATTRIBUTE(fallthrough) \
&& (!defined(__apple_build_version__) || __apple_build_version__ >= 7000000) && (!defined(__apple_build_version__) || __apple_build_version__ >= 7000000)
# define FALLTHROUGH {} __attribute__((fallthrough)) # define FALLTHROUGH {} __attribute__((fallthrough))
#else #else
# define FALLTHROUGH # define FALLTHROUGH
@ -204,29 +204,29 @@
/// ///
#if defined(__clang__) && __clang__ == 1 #if defined(__clang__) && __clang__ == 1
# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \ # define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \
_Pragma("clang diagnostic push") \ _Pragma("clang diagnostic push")\
_Pragma("clang diagnostic ignored \"-Wmissing-prototypes\"") _Pragma("clang diagnostic ignored \"-Wmissing-prototypes\"")
# ifdef HAVE_WIMPLICIT_FALLTHROUGH_FLAG # ifdef HAVE_WIMPLICIT_FALLTHROUGH_FLAG
# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \ # define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \
_Pragma("clang diagnostic push") \ _Pragma("clang diagnostic push")\
_Pragma("clang diagnostic ignored \"-Wimplicit-fallthrough\"") _Pragma("clang diagnostic ignored \"-Wimplicit-fallthrough\"")
# else # else
# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \ # define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \
_Pragma("clang diagnostic push") _Pragma("clang diagnostic push")
# endif # endif
# define PRAGMA_DIAG_POP \ # define PRAGMA_DIAG_POP \
_Pragma("clang diagnostic pop") _Pragma("clang diagnostic pop")
#elif defined(__GNUC__) #elif defined(__GNUC__)
# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \ # define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \
_Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic push")\
_Pragma("GCC diagnostic ignored \"-Wmissing-prototypes\"") _Pragma("GCC diagnostic ignored \"-Wmissing-prototypes\"")
# ifdef HAVE_WIMPLICIT_FALLTHROUGH_FLAG # ifdef HAVE_WIMPLICIT_FALLTHROUGH_FLAG
# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \ # define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \
_Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic push")\
_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
# else # else
# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \ # define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \
_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic push")
# endif # endif
# define PRAGMA_DIAG_POP \ # define PRAGMA_DIAG_POP \
_Pragma("GCC diagnostic pop") _Pragma("GCC diagnostic pop")

View File

@ -1,8 +1,8 @@
#ifndef NVIM_MAIN_H #ifndef NVIM_MAIN_H
#define NVIM_MAIN_H #define NVIM_MAIN_H
#include "nvim/normal.h"
#include "nvim/event/loop.h" #include "nvim/event/loop.h"
#include "nvim/normal.h"
// Maximum number of commands from + or -c arguments. // Maximum number of commands from + or -c arguments.
#define MAX_ARG_CMDS 10 #define MAX_ARG_CMDS 10

View File

@ -3,11 +3,11 @@
#include <stdbool.h> #include <stdbool.h>
#include "nvim/map_defs.h"
#include "nvim/extmark_defs.h"
#include "nvim/api/private/defs.h" #include "nvim/api/private/defs.h"
#include "nvim/api/private/dispatch.h" #include "nvim/api/private/dispatch.h"
#include "nvim/extmark_defs.h"
#include "nvim/highlight_defs.h" #include "nvim/highlight_defs.h"
#include "nvim/map_defs.h"
#if defined(__NetBSD__) #if defined(__NetBSD__)
# undef uint64_t # undef uint64_t
@ -60,7 +60,7 @@ MAP_DECLS(String, handle_T)
MAP_DECLS(ColorKey, ColorItem) MAP_DECLS(ColorKey, ColorItem)
#define MAP_INIT { { 0, 0, 0, 0, NULL, NULL, NULL } } #define MAP_INIT { { 0, 0, 0, 0, NULL, NULL, NULL } }
#define map_init(k, v, map) do { *(map) = (Map(k, v))MAP_INIT; } while (false) #define map_init(k, v, map) do { *(map) = (Map(k, v)) MAP_INIT; } while (false)
#define map_destroy(T, U) map_##T##_##U##_destroy #define map_destroy(T, U) map_##T##_##U##_destroy
#define map_get(T, U) map_##T##_##U##_get #define map_get(T, U) map_##T##_##U##_get

View File

@ -1,55 +1,55 @@
#ifndef NVIM_MARK_H #ifndef NVIM_MARK_H
#define NVIM_MARK_H #define NVIM_MARK_H
#include "nvim/macros.h"
#include "nvim/ascii.h" #include "nvim/ascii.h"
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/func_attr.h" #include "nvim/ex_cmds_defs.h" // for exarg_T
#include "nvim/mark_defs.h"
#include "nvim/extmark_defs.h" #include "nvim/extmark_defs.h"
#include "nvim/func_attr.h"
#include "nvim/macros.h"
#include "nvim/mark_defs.h"
#include "nvim/memory.h" #include "nvim/memory.h"
#include "nvim/pos.h"
#include "nvim/os/time.h" #include "nvim/os/time.h"
#include "nvim/ex_cmds_defs.h" // for exarg_T #include "nvim/pos.h"
/// Set fmark using given value /// Set fmark using given value
#define SET_FMARK(fmarkp_, mark_, fnum_) \ #define SET_FMARK(fmarkp_, mark_, fnum_) \
do { \ do { \
fmark_T *const fmarkp__ = fmarkp_; \ fmark_T *const fmarkp__ = fmarkp_; \
fmarkp__->mark = mark_; \ fmarkp__->mark = mark_; \
fmarkp__->fnum = fnum_; \ fmarkp__->fnum = fnum_; \
fmarkp__->timestamp = os_time(); \ fmarkp__->timestamp = os_time(); \
fmarkp__->additional_data = NULL; \ fmarkp__->additional_data = NULL; \
} while (0) } while (0)
/// Free and set fmark using given value /// Free and set fmark using given value
#define RESET_FMARK(fmarkp_, mark_, fnum_) \ #define RESET_FMARK(fmarkp_, mark_, fnum_) \
do { \ do { \
fmark_T *const fmarkp___ = fmarkp_; \ fmark_T *const fmarkp___ = fmarkp_; \
free_fmark(*fmarkp___); \ free_fmark(*fmarkp___); \
SET_FMARK(fmarkp___, mark_, fnum_); \ SET_FMARK(fmarkp___, mark_, fnum_); \
} while (0) } while (0)
/// Clear given fmark /// Clear given fmark
#define CLEAR_FMARK(fmarkp_) \ #define CLEAR_FMARK(fmarkp_) \
RESET_FMARK(fmarkp_, ((pos_T) { 0, 0, 0 }), 0) RESET_FMARK(fmarkp_, ((pos_T) { 0, 0, 0 }), 0)
/// Set given extended mark (regular mark + file name) /// Set given extended mark (regular mark + file name)
#define SET_XFMARK(xfmarkp_, mark_, fnum_, fname_) \ #define SET_XFMARK(xfmarkp_, mark_, fnum_, fname_) \
do { \ do { \
xfmark_T *const xfmarkp__ = xfmarkp_; \ xfmark_T *const xfmarkp__ = xfmarkp_; \
xfmarkp__->fname = fname_; \ xfmarkp__->fname = fname_; \
SET_FMARK(&(xfmarkp__->fmark), mark_, fnum_); \ SET_FMARK(&(xfmarkp__->fmark), mark_, fnum_); \
} while (0) } while (0)
/// Free and set given extended mark (regular mark + file name) /// Free and set given extended mark (regular mark + file name)
#define RESET_XFMARK(xfmarkp_, mark_, fnum_, fname_) \ #define RESET_XFMARK(xfmarkp_, mark_, fnum_, fname_) \
do { \ do { \
xfmark_T *const xfmarkp__ = xfmarkp_; \ xfmark_T *const xfmarkp__ = xfmarkp_; \
free_xfmark(*xfmarkp__); \ free_xfmark(*xfmarkp__); \
xfmarkp__->fname = fname_; \ xfmarkp__->fname = fname_; \
SET_FMARK(&(xfmarkp__->fmark), mark_, fnum_); \ SET_FMARK(&(xfmarkp__->fmark), mark_, fnum_); \
} while (0) } while (0)
/// Convert mark name to the offset /// Convert mark name to the offset
static inline int mark_global_index(const char name) static inline int mark_global_index(const char name)

View File

@ -1,9 +1,9 @@
#ifndef NVIM_MARK_DEFS_H #ifndef NVIM_MARK_DEFS_H
#define NVIM_MARK_DEFS_H #define NVIM_MARK_DEFS_H
#include "nvim/pos.h"
#include "nvim/os/time.h"
#include "nvim/eval/typval.h" #include "nvim/eval/typval.h"
#include "nvim/os/time.h"
#include "nvim/pos.h"
/* /*
* marks: positions in a file * marks: positions in a file
@ -42,7 +42,7 @@ typedef struct filemark {
/// Structure defining extended mark (mark with file name attached) /// Structure defining extended mark (mark with file name attached)
typedef struct xfilemark { typedef struct xfilemark {
fmark_T fmark; ///< Actual mark. fmark_T fmark; ///< Actual mark.
char_u *fname; ///< File name, used when fnum == 0. char_u *fname; ///< File name, used when fnum == 0.
} xfmark_T; } xfmark_T;
#endif // NVIM_MARK_DEFS_H #endif // NVIM_MARK_DEFS_H

View File

@ -2,9 +2,10 @@
#define NVIM_MARKTREE_H #define NVIM_MARKTREE_H
#include <stdint.h> #include <stdint.h>
#include "nvim/pos.h"
#include "nvim/map.h"
#include "nvim/garray.h" #include "nvim/garray.h"
#include "nvim/map.h"
#include "nvim/pos.h"
#define MT_MAX_DEPTH 20 #define MT_MAX_DEPTH 20
#define MT_BRANCH_FACTOR 10 #define MT_BRANCH_FACTOR 10

View File

@ -2,7 +2,6 @@
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
#include <math.h> #include <math.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>

View File

@ -1,12 +1,12 @@
#ifndef NVIM_MBYTE_H #ifndef NVIM_MBYTE_H
#define NVIM_MBYTE_H #define NVIM_MBYTE_H
#include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#include <string.h> #include <string.h>
#include "nvim/iconv.h"
#include "nvim/func_attr.h" #include "nvim/func_attr.h"
#include "nvim/iconv.h"
#include "nvim/os/os_defs.h" // For indirect #include "nvim/os/os_defs.h" // For indirect
#include "nvim/types.h" // for char_u #include "nvim/types.h" // for char_u
@ -22,21 +22,21 @@
// max length of an unicode char // max length of an unicode char
#define MB_MAXCHAR 6 #define MB_MAXCHAR 6
/* properties used in enc_canon_table[] (first three mutually exclusive) */ // properties used in enc_canon_table[] (first three mutually exclusive)
#define ENC_8BIT 0x01 #define ENC_8BIT 0x01
#define ENC_DBCS 0x02 #define ENC_DBCS 0x02
#define ENC_UNICODE 0x04 #define ENC_UNICODE 0x04
#define ENC_ENDIAN_B 0x10 /* Unicode: Big endian */ #define ENC_ENDIAN_B 0x10 // Unicode: Big endian
#define ENC_ENDIAN_L 0x20 /* Unicode: Little endian */ #define ENC_ENDIAN_L 0x20 // Unicode: Little endian
#define ENC_2BYTE 0x40 /* Unicode: UCS-2 */ #define ENC_2BYTE 0x40 // Unicode: UCS-2
#define ENC_4BYTE 0x80 /* Unicode: UCS-4 */ #define ENC_4BYTE 0x80 // Unicode: UCS-4
#define ENC_2WORD 0x100 /* Unicode: UTF-16 */ #define ENC_2WORD 0x100 // Unicode: UTF-16
#define ENC_LATIN1 0x200 /* Latin1 */ #define ENC_LATIN1 0x200 // Latin1
#define ENC_LATIN9 0x400 /* Latin9 */ #define ENC_LATIN9 0x400 // Latin9
#define ENC_MACROMAN 0x800 /* Mac Roman (not Macro Man! :-) */ #define ENC_MACROMAN 0x800 // Mac Roman (not Macro Man! :-)
// TODO(bfredl): eventually we should keep only one of the namings // TODO(bfredl): eventually we should keep only one of the namings
#define mb_ptr2len utfc_ptr2len #define mb_ptr2len utfc_ptr2len
@ -63,9 +63,9 @@ typedef enum {
typedef struct { typedef struct {
int vc_type; ///< Zero or more ConvFlags. int vc_type; ///< Zero or more ConvFlags.
int vc_factor; ///< Maximal expansion factor. int vc_factor; ///< Maximal expansion factor.
# ifdef HAVE_ICONV #ifdef HAVE_ICONV
iconv_t vc_fd; ///< Value for CONV_ICONV. iconv_t vc_fd; ///< Value for CONV_ICONV.
# endif #endif
bool vc_fail; ///< What to do with invalid characters: if true, fail, bool vc_fail; ///< What to do with invalid characters: if true, fail,
///< otherwise use '?'. ///< otherwise use '?'.
} vimconv_T; } vimconv_T;

View File

@ -1,12 +1,12 @@
#ifndef NVIM_MEMFILE_DEFS_H #ifndef NVIM_MEMFILE_DEFS_H
#define NVIM_MEMFILE_DEFS_H #define NVIM_MEMFILE_DEFS_H
#include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include "nvim/types.h"
#include "nvim/pos.h" #include "nvim/pos.h"
#include "nvim/types.h"
/// A block number. /// A block number.
/// ///

View File

@ -1,9 +1,9 @@
#ifndef NVIM_MEMLINE_H #ifndef NVIM_MEMLINE_H
#define NVIM_MEMLINE_H #define NVIM_MEMLINE_H
#include "nvim/buffer_defs.h" // for buf_T
#include "nvim/pos.h" // for pos_T, linenr_T, colnr_T
#include "nvim/types.h" #include "nvim/types.h"
#include "nvim/pos.h" // for pos_T, linenr_T, colnr_T
#include "nvim/buffer_defs.h" // for buf_T
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "memline.h.generated.h" # include "memline.h.generated.h"

View File

@ -43,9 +43,9 @@ typedef struct ml_chunksize {
typedef struct memline { typedef struct memline {
linenr_T ml_line_count; // number of lines in the buffer linenr_T ml_line_count; // number of lines in the buffer
memfile_T *ml_mfp; // pointer to associated memfile memfile_T *ml_mfp; // pointer to associated memfile
infoptr_T *ml_stack; // stack of pointer blocks (array of IPTRs) infoptr_T *ml_stack; // stack of pointer blocks (array of IPTRs)
int ml_stack_top; // current top of ml_stack int ml_stack_top; // current top of ml_stack
int ml_stack_size; // total number of entries in ml_stack int ml_stack_size; // total number of entries in ml_stack
@ -56,11 +56,11 @@ typedef struct memline {
int ml_flags; int ml_flags;
linenr_T ml_line_lnum; // line number of cached line, 0 if not valid linenr_T ml_line_lnum; // line number of cached line, 0 if not valid
char_u *ml_line_ptr; // pointer to cached line char_u *ml_line_ptr; // pointer to cached line
size_t ml_line_offset; // cached byte offset of ml_line_lnum size_t ml_line_offset; // cached byte offset of ml_line_lnum
int ml_line_offset_ff; // fileformat of cached line int ml_line_offset_ff; // fileformat of cached line
bhdr_T *ml_locked; // block used by last ml_get bhdr_T *ml_locked; // block used by last ml_get
linenr_T ml_locked_low; // first line in ml_locked linenr_T ml_locked_low; // first line in ml_locked
linenr_T ml_locked_high; // last line in ml_locked linenr_T ml_locked_high; // last line in ml_locked
int ml_locked_lineadd; // number of lines inserted in ml_locked int ml_locked_lineadd; // number of lines inserted in ml_locked

View File

@ -2,8 +2,8 @@
#define NVIM_MEMORY_H #define NVIM_MEMORY_H
#include <stdbool.h> // for bool #include <stdbool.h> // for bool
#include <stdint.h> // for uint8_t
#include <stddef.h> // for size_t #include <stddef.h> // for size_t
#include <stdint.h> // for uint8_t
#include <time.h> // for time_t #include <time.h> // for time_t
/// `malloc()` function signature /// `malloc()` function signature

View File

@ -1,10 +1,10 @@
#ifndef NVIM_MENU_H #ifndef NVIM_MENU_H
#define NVIM_MENU_H #define NVIM_MENU_H
#include <stdbool.h> // for bool #include <stdbool.h> // for bool
#include "nvim/types.h" // for char_u and expand_T #include "nvim/ex_cmds_defs.h" // for exarg_T
#include "nvim/ex_cmds_defs.h" // for exarg_T #include "nvim/types.h" // for char_u and expand_T
/// @} /// @}
/// note MENU_INDEX_TIP is not a 'real' mode /// note MENU_INDEX_TIP is not a 'real' mode

View File

@ -1,15 +1,15 @@
#ifndef NVIM_MESSAGE_H #ifndef NVIM_MESSAGE_H
#define NVIM_MESSAGE_H #define NVIM_MESSAGE_H
#include <stdbool.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include "nvim/api/private/defs.h"
#include "nvim/grid_defs.h"
#include "nvim/lib/kvec.h"
#include "nvim/macros.h" #include "nvim/macros.h"
#include "nvim/types.h" #include "nvim/types.h"
#include "nvim/grid_defs.h"
#include "nvim/api/private/defs.h"
#include "nvim/lib/kvec.h"
/* /*
* Types of dialogs passed to do_dialog(). * Types of dialogs passed to do_dialog().
@ -19,7 +19,7 @@
#define VIM_WARNING 2 #define VIM_WARNING 2
#define VIM_INFO 3 #define VIM_INFO 3
#define VIM_QUESTION 4 #define VIM_QUESTION 4
#define VIM_LAST_TYPE 4 /* sentinel value */ #define VIM_LAST_TYPE 4 // sentinel value
/* /*
* Return values for functions like vim_dialogyesno() * Return values for functions like vim_dialogyesno()
@ -42,16 +42,16 @@
#define EMSG(s) emsg((char_u *)(s)) #define EMSG(s) emsg((char_u *)(s))
/// Like #EMSG, but for messages with one "%s" inside /// Like #EMSG, but for messages with one "%s" inside
#define EMSG2(s, p) emsgf((const char *) (s), (p)) #define EMSG2(s, p) emsgf((const char *)(s), (p))
/// Like #EMSG, but for messages with two "%s" inside /// Like #EMSG, but for messages with two "%s" inside
#define EMSG3(s, p, q) emsgf((const char *) (s), (p), (q)) #define EMSG3(s, p, q) emsgf((const char *)(s), (p), (q))
/// Like #EMSG, but for messages with one "%" PRId64 inside /// Like #EMSG, but for messages with one "%" PRId64 inside
#define EMSGN(s, n) emsgf((const char *) (s), (int64_t)(n)) #define EMSGN(s, n) emsgf((const char *)(s), (int64_t)(n))
/// Like #EMSG, but for messages with one "%" PRIu64 inside /// Like #EMSG, but for messages with one "%" PRIu64 inside
#define EMSGU(s, n) emsgf((const char *) (s), (uint64_t)(n)) #define EMSGU(s, n) emsgf((const char *)(s), (uint64_t)(n))
/// Like #EMSG, but for internal messages /// Like #EMSG, but for internal messages
#define IEMSG(s) iemsg((const char *)(s)) #define IEMSG(s) iemsg((const char *)(s))

View File

@ -1,15 +1,15 @@
#ifndef NVIM_MISC1_H #ifndef NVIM_MISC1_H
#define NVIM_MISC1_H #define NVIM_MISC1_H
#include "nvim/vim.h"
#include "nvim/os/shell.h" #include "nvim/os/shell.h"
#include "nvim/vim.h"
/* flags for open_line() */ // flags for open_line()
#define OPENLINE_DELSPACES 1 /* delete spaces after cursor */ #define OPENLINE_DELSPACES 1 // delete spaces after cursor
#define OPENLINE_DO_COM 2 /* format comments */ #define OPENLINE_DO_COM 2 // format comments
#define OPENLINE_KEEPTRAIL 4 /* keep trailing spaces */ #define OPENLINE_KEEPTRAIL 4 // keep trailing spaces
#define OPENLINE_MARKFIX 8 /* fix mark positions */ #define OPENLINE_MARKFIX 8 // fix mark positions
#define OPENLINE_COM_LIST 16 /* format comments with list/2nd line indent */ #define OPENLINE_COM_LIST 16 // format comments with list/2nd line indent
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "misc1.h.generated.h" # include "misc1.h.generated.h"

View File

@ -3,8 +3,8 @@
#include <stdbool.h> #include <stdbool.h>
#include "nvim/vim.h"
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/vim.h"
// jump_to_mouse() returns one of first four these values, possibly with // jump_to_mouse() returns one of first four these values, possibly with
// some of the other three added. // some of the other three added.

View File

@ -2,6 +2,7 @@
#define NVIM_MOVE_H #define NVIM_MOVE_H
#include <stdbool.h> #include <stdbool.h>
#include "nvim/vim.h" #include "nvim/vim.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS

View File

@ -2,13 +2,14 @@
#define NVIM_NORMAL_H #define NVIM_NORMAL_H
#include <stdbool.h> #include <stdbool.h>
#include "nvim/pos.h"
#include "nvim/buffer_defs.h" // for win_T
/* Values for find_ident_under_cursor() */ #include "nvim/buffer_defs.h" // for win_T
#define FIND_IDENT 1 /* find identifier (word) */ #include "nvim/pos.h"
#define FIND_STRING 2 /* find any string (WORD) */
#define FIND_EVAL 4 /* include "->", "[]" and "." */ // Values for find_ident_under_cursor()
#define FIND_IDENT 1 // find identifier (word)
#define FIND_STRING 2 // find any string (WORD)
#define FIND_EVAL 4 // include "->", "[]" and "."
/// Motion types, used for operators and for yank/delete registers. /// Motion types, used for operators and for yank/delete registers.
/// ///
@ -56,24 +57,24 @@ typedef struct oparg_S {
* Arguments for Normal mode commands. * Arguments for Normal mode commands.
*/ */
typedef struct cmdarg_S { typedef struct cmdarg_S {
oparg_T *oap; /* Operator arguments */ oparg_T *oap; // Operator arguments
int prechar; /* prefix character (optional, always 'g') */ int prechar; // prefix character (optional, always 'g')
int cmdchar; /* command character */ int cmdchar; // command character
int nchar; /* next command character (optional) */ int nchar; // next command character (optional)
int ncharC1; /* first composing character (optional) */ int ncharC1; // first composing character (optional)
int ncharC2; /* second composing character (optional) */ int ncharC2; // second composing character (optional)
int extra_char; /* yet another character (optional) */ int extra_char; // yet another character (optional)
long opcount; /* count before an operator */ long opcount; // count before an operator
long count0; /* count before command, default 0 */ long count0; // count before command, default 0
long count1; /* count before command, default 1 */ long count1; // count before command, default 1
int arg; /* extra argument from nv_cmds[] */ int arg; // extra argument from nv_cmds[]
int retval; /* return: CA_* values */ int retval; // return: CA_* values
char_u *searchbuf; /* return: pointer to search pattern or NULL */ char_u *searchbuf; // return: pointer to search pattern or NULL
} cmdarg_T; } cmdarg_T;
/* values for retval: */ // values for retval:
#define CA_COMMAND_BUSY 1 /* skip restarting edit() once */ #define CA_COMMAND_BUSY 1 // skip restarting edit() once
#define CA_NO_ADJ_OP_END 2 /* don't adjust operator end */ #define CA_NO_ADJ_OP_END 2 // don't adjust operator end
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS

View File

@ -3,14 +3,14 @@
#include <stdbool.h> #include <stdbool.h>
#include "nvim/macros.h"
#include "nvim/ascii.h" #include "nvim/ascii.h"
#include "nvim/types.h"
#include "nvim/extmark.h"
#include "nvim/eval/typval.h" #include "nvim/eval/typval.h"
#include "nvim/ex_cmds_defs.h" // for exarg_T
#include "nvim/extmark.h"
#include "nvim/macros.h"
#include "nvim/normal.h" // for MotionType and oparg_T
#include "nvim/os/time.h" #include "nvim/os/time.h"
#include "nvim/normal.h" // for MotionType and oparg_T #include "nvim/types.h"
#include "nvim/ex_cmds_defs.h" // for exarg_T
typedef int (*Indenter)(void); typedef int (*Indenter)(void);

View File

@ -3,10 +3,10 @@
#include "nvim/ex_cmds_defs.h" // for exarg_T #include "nvim/ex_cmds_defs.h" // for exarg_T
/* flags for buf_copy_options() */ // flags for buf_copy_options()
#define BCO_ENTER 1 /* going to enter the buffer */ #define BCO_ENTER 1 // going to enter the buffer
#define BCO_ALWAYS 2 /* always copy the options */ #define BCO_ALWAYS 2 // always copy the options
#define BCO_NOHELP 4 /* don't touch the help related options */ #define BCO_NOHELP 4 // don't touch the help related options
/// Flags for option-setting functions /// Flags for option-setting functions
/// ///

View File

@ -1,9 +1,9 @@
#ifndef NVIM_OPTION_DEFS_H #ifndef NVIM_OPTION_DEFS_H
#define NVIM_OPTION_DEFS_H #define NVIM_OPTION_DEFS_H
#include "nvim/types.h"
#include "nvim/macros.h" // For EXTERN
#include "eval/typval.h" // For scid_T #include "eval/typval.h" // For scid_T
#include "nvim/macros.h" // For EXTERN
#include "nvim/types.h"
// option_defs.h: definition of global variables for settable options // option_defs.h: definition of global variables for settable options
@ -25,9 +25,11 @@
// The "%f|%l| %m" one is used for when the contents of the quickfix window is // The "%f|%l| %m" one is used for when the contents of the quickfix window is
// written to a file. // written to a file.
#ifdef WIN32 #ifdef WIN32
# 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" # 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 #else
# define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%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" # define DFLT_EFM \
"%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%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 #endif
#define DFLT_GREPFORMAT "%f:%l:%m,%f:%l%m,%f %l%m" #define DFLT_GREPFORMAT "%f:%l:%m,%f:%l%m,%f %l%m"
@ -42,17 +44,17 @@
# define DFLT_FFS_VIM "dos,unix" # define DFLT_FFS_VIM "dos,unix"
# define DFLT_FFS_VI "dos,unix" // also autodetect in compatible mode # define DFLT_FFS_VI "dos,unix" // also autodetect in compatible mode
#else #else
# define DFLT_FF "unix" # define DFLT_FF "unix"
# define DFLT_FFS_VIM "unix,dos" # define DFLT_FFS_VIM "unix,dos"
# define DFLT_FFS_VI "" # define DFLT_FFS_VI ""
#endif #endif
// Possible values for 'encoding' // Possible values for 'encoding'
# define ENC_UCSBOM "ucs-bom" // check for BOM at start of file #define ENC_UCSBOM "ucs-bom" // check for BOM at start of file
// default value for 'encoding' // default value for 'encoding'
# define ENC_DFLT "utf-8" #define ENC_DFLT "utf-8"
// end-of-line style // end-of-line style
#define EOL_UNKNOWN -1 // not defined yet #define EOL_UNKNOWN -1 // not defined yet
@ -179,9 +181,9 @@ enum {
}; };
/// Represented by 'a' flag. /// Represented by 'a' flag.
#define SHM_ALL_ABBREVIATIONS ((char_u[]) { \ #define SHM_ALL_ABBREVIATIONS ((char_u[]) { \
SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \ SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \
0, \ 0, \
}) })
// characters for p_go: // characters for p_go:
#define GO_ASEL 'a' // autoselect #define GO_ASEL 'a' // autoselect
@ -264,16 +266,16 @@ enum {
}; };
/// C string containing all 'statusline' option flags /// C string containing all 'statusline' option flags
#define STL_ALL ((char_u[]) { \ #define STL_ALL ((char_u[]) { \
STL_FILEPATH, STL_FULLPATH, STL_FILENAME, STL_COLUMN, STL_VIRTCOL, \ STL_FILEPATH, STL_FULLPATH, STL_FILENAME, STL_COLUMN, STL_VIRTCOL, \
STL_VIRTCOL_ALT, STL_LINE, STL_NUMLINES, STL_BUFNO, STL_KEYMAP, STL_OFFSET, \ 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_OFFSET_X, STL_BYTEVAL, STL_BYTEVAL_X, STL_ROFLAG, STL_ROFLAG_ALT, \
STL_HELPFLAG, STL_HELPFLAG_ALT, STL_FILETYPE, STL_FILETYPE_ALT, \ STL_HELPFLAG, STL_HELPFLAG_ALT, STL_FILETYPE, STL_FILETYPE_ALT, \
STL_PREVIEWFLAG, STL_PREVIEWFLAG_ALT, STL_MODIFIED, STL_MODIFIED_ALT, \ STL_PREVIEWFLAG, STL_PREVIEWFLAG_ALT, STL_MODIFIED, STL_MODIFIED_ALT, \
STL_QUICKFIX, STL_PERCENTAGE, STL_ALTPERCENT, STL_ARGLISTSTAT, STL_PAGENUM, \ STL_QUICKFIX, STL_PERCENTAGE, STL_ALTPERCENT, STL_ARGLISTSTAT, STL_PAGENUM, \
STL_VIM_EXPR, STL_SEPARATE, STL_TRUNCMARK, STL_USER_HL, STL_HIGHLIGHT, \ 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, \ 0, \
}) })
// flags used for parsed 'wildmode' // flags used for parsed 'wildmode'
#define WIM_FULL 0x01 #define WIM_FULL 0x01
@ -305,36 +307,36 @@ enum {
EXTERN long p_aleph; // 'aleph' EXTERN long p_aleph; // 'aleph'
EXTERN int p_acd; // 'autochdir' EXTERN int p_acd; // 'autochdir'
EXTERN char_u *p_ambw; // 'ambiwidth' EXTERN char_u *p_ambw; // 'ambiwidth'
EXTERN int p_ar; // 'autoread' EXTERN int p_ar; // 'autoread'
EXTERN int p_aw; // 'autowrite' EXTERN int p_aw; // 'autowrite'
EXTERN int p_awa; // 'autowriteall' EXTERN int p_awa; // 'autowriteall'
EXTERN char_u *p_bs; // 'backspace' EXTERN char_u *p_bs; // 'backspace'
EXTERN char_u *p_bg; // 'background' EXTERN char_u *p_bg; // 'background'
EXTERN int p_bk; // 'backup' EXTERN int p_bk; // 'backup'
EXTERN char_u *p_bkc; // 'backupcopy' EXTERN char_u *p_bkc; // 'backupcopy'
EXTERN unsigned int bkc_flags; ///< flags from 'backupcopy' EXTERN unsigned int bkc_flags; ///< flags from 'backupcopy'
#ifdef IN_OPTION_C #ifdef IN_OPTION_C
static char *(p_bkc_values[]) = static char *(p_bkc_values[]) =
{"yes", "auto", "no", "breaksymlink", "breakhardlink", NULL}; { "yes", "auto", "no", "breaksymlink", "breakhardlink", NULL };
#endif #endif
# define BKC_YES 0x001 #define BKC_YES 0x001
# define BKC_AUTO 0x002 #define BKC_AUTO 0x002
# define BKC_NO 0x004 #define BKC_NO 0x004
# define BKC_BREAKSYMLINK 0x008 #define BKC_BREAKSYMLINK 0x008
# define BKC_BREAKHARDLINK 0x010 #define BKC_BREAKHARDLINK 0x010
EXTERN char_u *p_bdir; // 'backupdir' EXTERN char_u *p_bdir; // 'backupdir'
EXTERN char_u *p_bex; // 'backupext' EXTERN char_u *p_bex; // 'backupext'
EXTERN char_u *p_bo; // 'belloff' EXTERN char_u *p_bo; // 'belloff'
EXTERN char breakat_flags[256]; // which characters are in 'breakat' EXTERN char breakat_flags[256]; // which characters are in 'breakat'
EXTERN unsigned bo_flags; EXTERN unsigned bo_flags;
# ifdef IN_OPTION_C #ifdef IN_OPTION_C
static char *(p_bo_values[]) = {"all", "backspace", "cursor", "complete", static char *(p_bo_values[]) = { "all", "backspace", "cursor", "complete",
"copy", "ctrlg", "error", "esc", "ex", "copy", "ctrlg", "error", "esc", "ex",
"hangul", "insertmode", "lang", "mess", "hangul", "insertmode", "lang", "mess",
"showmatch", "operator", "register", "shell", "showmatch", "operator", "register", "shell",
"spell", "wildmode", NULL}; "spell", "wildmode", NULL };
# endif #endif
// values for the 'belloff' option // values for the 'belloff' option
#define BO_ALL 0x0001 #define BO_ALL 0x0001
@ -357,61 +359,61 @@ static char *(p_bo_values[]) = {"all", "backspace", "cursor", "complete",
#define BO_SPELL 0x20000 #define BO_SPELL 0x20000
#define BO_WILD 0x40000 #define BO_WILD 0x40000
EXTERN char_u *p_bsk; // 'backupskip' EXTERN char_u *p_bsk; // 'backupskip'
EXTERN char_u *p_breakat; // 'breakat' EXTERN char_u *p_breakat; // 'breakat'
EXTERN char_u *p_cmp; // 'casemap' EXTERN char_u *p_cmp; // 'casemap'
EXTERN unsigned cmp_flags; EXTERN unsigned cmp_flags;
# ifdef IN_OPTION_C #ifdef IN_OPTION_C
static char *(p_cmp_values[]) = {"internal", "keepascii", NULL}; static char *(p_cmp_values[]) = { "internal", "keepascii", NULL };
# endif #endif
# define CMP_INTERNAL 0x001 #define CMP_INTERNAL 0x001
# define CMP_KEEPASCII 0x002 #define CMP_KEEPASCII 0x002
EXTERN char_u *p_enc; // 'encoding' EXTERN char_u *p_enc; // 'encoding'
EXTERN int p_deco; // 'delcombine' EXTERN int p_deco; // 'delcombine'
EXTERN char_u *p_ccv; // 'charconvert' EXTERN char_u *p_ccv; // 'charconvert'
EXTERN char_u *p_cedit; // 'cedit' EXTERN char_u *p_cedit; // 'cedit'
EXTERN char_u *p_cb; // 'clipboard' EXTERN char_u *p_cb; // 'clipboard'
EXTERN unsigned cb_flags; EXTERN unsigned cb_flags;
#ifdef IN_OPTION_C #ifdef IN_OPTION_C
static char *(p_cb_values[]) = {"unnamed", "unnamedplus", NULL}; static char *(p_cb_values[]) = { "unnamed", "unnamedplus", NULL };
#endif #endif
# define CB_UNNAMED 0x001 #define CB_UNNAMED 0x001
# define CB_UNNAMEDPLUS 0x002 #define CB_UNNAMEDPLUS 0x002
# define CB_UNNAMEDMASK (CB_UNNAMED | CB_UNNAMEDPLUS) #define CB_UNNAMEDMASK (CB_UNNAMED | CB_UNNAMEDPLUS)
EXTERN long p_cwh; // 'cmdwinheight' EXTERN long p_cwh; // 'cmdwinheight'
EXTERN long p_ch; // 'cmdheight' EXTERN long p_ch; // 'cmdheight'
EXTERN long p_columns; // 'columns' EXTERN long p_columns; // 'columns'
EXTERN int p_confirm; // 'confirm' EXTERN int p_confirm; // 'confirm'
EXTERN char_u *p_cot; // 'completeopt' EXTERN char_u *p_cot; // 'completeopt'
# ifdef BACKSLASH_IN_FILENAME #ifdef BACKSLASH_IN_FILENAME
EXTERN char_u *p_csl; // 'completeslash' EXTERN char_u *p_csl; // 'completeslash'
# endif #endif
EXTERN long p_pb; // 'pumblend' EXTERN long p_pb; // 'pumblend'
EXTERN long p_ph; // 'pumheight' EXTERN long p_ph; // 'pumheight'
EXTERN long p_pw; // 'pumwidth' EXTERN long p_pw; // 'pumwidth'
EXTERN char_u *p_cpo; // 'cpoptions' EXTERN char_u *p_cpo; // 'cpoptions'
EXTERN char_u *p_csprg; // 'cscopeprg' EXTERN char_u *p_csprg; // 'cscopeprg'
EXTERN int p_csre; // 'cscoperelative' EXTERN int p_csre; // 'cscoperelative'
EXTERN char_u *p_csqf; // 'cscopequickfix' EXTERN char_u *p_csqf; // 'cscopequickfix'
# define CSQF_CMDS "sgdctefia" #define CSQF_CMDS "sgdctefia"
# define CSQF_FLAGS "+-0" #define CSQF_FLAGS "+-0"
EXTERN int p_cst; // 'cscopetag' EXTERN int p_cst; // 'cscopetag'
EXTERN long p_csto; // 'cscopetagorder' EXTERN long p_csto; // 'cscopetagorder'
EXTERN long p_cspc; // 'cscopepathcomp' EXTERN long p_cspc; // 'cscopepathcomp'
EXTERN int p_csverbose; // 'cscopeverbose' EXTERN int p_csverbose; // 'cscopeverbose'
EXTERN char_u *p_debug; // 'debug' EXTERN char_u *p_debug; // 'debug'
EXTERN char_u *p_def; // 'define' EXTERN char_u *p_def; // 'define'
EXTERN char_u *p_inc; EXTERN char_u *p_inc;
EXTERN char_u *p_dip; // 'diffopt' EXTERN char_u *p_dip; // 'diffopt'
EXTERN char_u *p_dex; // 'diffexpr' EXTERN char_u *p_dex; // 'diffexpr'
EXTERN char_u *p_dict; // 'dictionary' EXTERN char_u *p_dict; // 'dictionary'
EXTERN int p_dg; // 'digraph' EXTERN int p_dg; // 'digraph'
EXTERN char_u *p_dir; // 'directory' EXTERN char_u *p_dir; // 'directory'
EXTERN char_u *p_dy; // 'display' EXTERN char_u *p_dy; // 'display'
EXTERN unsigned dy_flags; EXTERN unsigned dy_flags;
#ifdef IN_OPTION_C #ifdef IN_OPTION_C
static char *(p_dy_values[]) = { "lastline", "truncate", "uhex", "msgsep", static char *(p_dy_values[]) = { "lastline", "truncate", "uhex", "msgsep",
NULL }; NULL };
#endif #endif
#define DY_LASTLINE 0x001 #define DY_LASTLINE 0x001
#define DY_TRUNCATE 0x002 #define DY_TRUNCATE 0x002
@ -420,72 +422,72 @@ static char *(p_dy_values[]) = { "lastline", "truncate", "uhex", "msgsep",
#define DY_MSGSEP 0x008 #define DY_MSGSEP 0x008
EXTERN int p_ed; // 'edcompatible' EXTERN int p_ed; // 'edcompatible'
EXTERN int p_emoji; // 'emoji' EXTERN int p_emoji; // 'emoji'
EXTERN char_u *p_ead; // 'eadirection' EXTERN char_u *p_ead; // 'eadirection'
EXTERN int p_ea; // 'equalalways' EXTERN int p_ea; // 'equalalways'
EXTERN char_u *p_ep; // 'equalprg' EXTERN char_u *p_ep; // 'equalprg'
EXTERN int p_eb; // 'errorbells' EXTERN int p_eb; // 'errorbells'
EXTERN char_u *p_ef; // 'errorfile' EXTERN char_u *p_ef; // 'errorfile'
EXTERN char_u *p_efm; // 'errorformat' EXTERN char_u *p_efm; // 'errorformat'
EXTERN char_u *p_gefm; // 'grepformat' EXTERN char_u *p_gefm; // 'grepformat'
EXTERN char_u *p_gp; // 'grepprg' EXTERN char_u *p_gp; // 'grepprg'
EXTERN char_u *p_ei; // 'eventignore' EXTERN char_u *p_ei; // 'eventignore'
EXTERN int p_exrc; // 'exrc' EXTERN int p_exrc; // 'exrc'
EXTERN char_u *p_fencs; // 'fileencodings' EXTERN char_u *p_fencs; // 'fileencodings'
EXTERN char_u *p_ffs; // 'fileformats' EXTERN char_u *p_ffs; // 'fileformats'
EXTERN int p_fic; // 'fileignorecase' EXTERN int p_fic; // 'fileignorecase'
EXTERN char_u *p_fcl; // 'foldclose' EXTERN char_u *p_fcl; // 'foldclose'
EXTERN long p_fdls; // 'foldlevelstart' EXTERN long p_fdls; // 'foldlevelstart'
EXTERN char_u *p_fdo; // 'foldopen' EXTERN char_u *p_fdo; // 'foldopen'
EXTERN unsigned fdo_flags; EXTERN unsigned fdo_flags;
# ifdef IN_OPTION_C #ifdef IN_OPTION_C
static char *(p_fdo_values[]) = {"all", "block", "hor", "mark", "percent", static char *(p_fdo_values[]) = { "all", "block", "hor", "mark", "percent",
"quickfix", "search", "tag", "insert", "quickfix", "search", "tag", "insert",
"undo", "jump", NULL}; "undo", "jump", NULL };
# endif #endif
# define FDO_ALL 0x001 #define FDO_ALL 0x001
# define FDO_BLOCK 0x002 #define FDO_BLOCK 0x002
# define FDO_HOR 0x004 #define FDO_HOR 0x004
# define FDO_MARK 0x008 #define FDO_MARK 0x008
# define FDO_PERCENT 0x010 #define FDO_PERCENT 0x010
# define FDO_QUICKFIX 0x020 #define FDO_QUICKFIX 0x020
# define FDO_SEARCH 0x040 #define FDO_SEARCH 0x040
# define FDO_TAG 0x080 #define FDO_TAG 0x080
# define FDO_INSERT 0x100 #define FDO_INSERT 0x100
# define FDO_UNDO 0x200 #define FDO_UNDO 0x200
# define FDO_JUMP 0x400 #define FDO_JUMP 0x400
EXTERN char_u *p_fp; // 'formatprg' EXTERN char_u *p_fp; // 'formatprg'
EXTERN int p_fs; // 'fsync' EXTERN int p_fs; // 'fsync'
EXTERN int p_gd; // 'gdefault' EXTERN int p_gd; // 'gdefault'
EXTERN char_u *p_pdev; // 'printdevice' EXTERN char_u *p_pdev; // 'printdevice'
EXTERN char_u *p_penc; // 'printencoding' EXTERN char_u *p_penc; // 'printencoding'
EXTERN char_u *p_pexpr; // 'printexpr' EXTERN char_u *p_pexpr; // 'printexpr'
EXTERN char_u *p_pmfn; // 'printmbfont' EXTERN char_u *p_pmfn; // 'printmbfont'
EXTERN char_u *p_pmcs; // 'printmbcharset' EXTERN char_u *p_pmcs; // 'printmbcharset'
EXTERN char_u *p_pfn; // 'printfont' EXTERN char_u *p_pfn; // 'printfont'
EXTERN char_u *p_popt; // 'printoptions' EXTERN char_u *p_popt; // 'printoptions'
EXTERN char_u *p_header; // 'printheader' EXTERN char_u *p_header; // 'printheader'
EXTERN char_u *p_guicursor; // 'guicursor' EXTERN char_u *p_guicursor; // 'guicursor'
EXTERN char_u *p_guifont; // 'guifont' EXTERN char_u *p_guifont; // 'guifont'
EXTERN char_u *p_guifontwide; // 'guifontwide' EXTERN char_u *p_guifontwide; // 'guifontwide'
EXTERN char_u *p_hf; // 'helpfile' EXTERN char_u *p_hf; // 'helpfile'
EXTERN long p_hh; // 'helpheight' EXTERN long p_hh; // 'helpheight'
EXTERN char_u *p_hlg; // 'helplang' EXTERN char_u *p_hlg; // 'helplang'
EXTERN int p_hid; // 'hidden' EXTERN int p_hid; // 'hidden'
EXTERN char_u *p_hl; // 'highlight' EXTERN char_u *p_hl; // 'highlight'
EXTERN int p_hls; // 'hlsearch' EXTERN int p_hls; // 'hlsearch'
EXTERN long p_hi; // 'history' EXTERN long p_hi; // 'history'
EXTERN int p_hkmap; // 'hkmap' EXTERN int p_hkmap; // 'hkmap'
EXTERN int p_hkmapp; // 'hkmapp' EXTERN int p_hkmapp; // 'hkmapp'
EXTERN int p_arshape; // 'arabicshape' EXTERN int p_arshape; // 'arabicshape'
EXTERN int p_icon; // 'icon' EXTERN int p_icon; // 'icon'
EXTERN char_u *p_iconstring; // 'iconstring' EXTERN char_u *p_iconstring; // 'iconstring'
EXTERN int p_ic; // 'ignorecase' EXTERN int p_ic; // 'ignorecase'
EXTERN int p_is; // 'incsearch' EXTERN int p_is; // 'incsearch'
EXTERN char_u *p_icm; // 'inccommand' EXTERN char_u *p_icm; // 'inccommand'
EXTERN int p_im; // 'insertmode' EXTERN int p_im; // 'insertmode'
EXTERN char_u *p_isf; // 'isfname' EXTERN char_u *p_isf; // 'isfname'
EXTERN char_u *p_isi; // 'isident' EXTERN char_u *p_isi; // 'isident'
EXTERN char_u *p_isp; // 'isprint' EXTERN char_u *p_isp; // 'isprint'
EXTERN int p_js; // 'joinspaces' EXTERN int p_js; // 'joinspaces'
EXTERN char_u *p_jop; // 'jumpooptions' EXTERN char_u *p_jop; // 'jumpooptions'
EXTERN unsigned jop_flags; EXTERN unsigned jop_flags;
@ -493,26 +495,26 @@ EXTERN unsigned jop_flags;
static char *(p_jop_values[]) = { "stack", NULL }; static char *(p_jop_values[]) = { "stack", NULL };
#endif #endif
#define JOP_STACK 0x01 #define JOP_STACK 0x01
EXTERN char_u *p_kp; // 'keywordprg' EXTERN char_u *p_kp; // 'keywordprg'
EXTERN char_u *p_km; // 'keymodel' EXTERN char_u *p_km; // 'keymodel'
EXTERN char_u *p_langmap; // 'langmap' EXTERN char_u *p_langmap; // 'langmap'
EXTERN int p_lnr; // 'langnoremap' EXTERN int p_lnr; // 'langnoremap'
EXTERN int p_lrm; // 'langremap' EXTERN int p_lrm; // 'langremap'
EXTERN char_u *p_lm; // 'langmenu' EXTERN char_u *p_lm; // 'langmenu'
EXTERN long p_lines; // 'lines' EXTERN long p_lines; // 'lines'
EXTERN long p_linespace; // 'linespace' EXTERN long p_linespace; // 'linespace'
EXTERN char_u *p_lispwords; // 'lispwords' EXTERN char_u *p_lispwords; // 'lispwords'
EXTERN long p_ls; // 'laststatus' EXTERN long p_ls; // 'laststatus'
EXTERN long p_stal; // 'showtabline' EXTERN long p_stal; // 'showtabline'
EXTERN char_u *p_lcs; // 'listchars' EXTERN char_u *p_lcs; // 'listchars'
EXTERN int p_lz; // 'lazyredraw' EXTERN int p_lz; // 'lazyredraw'
EXTERN int p_lpl; // 'loadplugins' EXTERN int p_lpl; // 'loadplugins'
EXTERN int p_magic; // 'magic' EXTERN int p_magic; // 'magic'
EXTERN char_u *p_menc; // 'makeencoding' EXTERN char_u *p_menc; // 'makeencoding'
EXTERN char_u *p_mef; // 'makeef' EXTERN char_u *p_mef; // 'makeef'
EXTERN char_u *p_mp; // 'makeprg' EXTERN char_u *p_mp; // 'makeprg'
EXTERN char_u *p_cc; // 'colorcolumn' EXTERN char_u *p_cc; // 'colorcolumn'
EXTERN int p_cc_cols[256]; // array for 'colorcolumn' columns EXTERN int p_cc_cols[256]; // array for 'colorcolumn' columns
EXTERN long p_mat; // 'matchtime' EXTERN long p_mat; // 'matchtime'
EXTERN long p_mco; // 'maxcombine' EXTERN long p_mco; // 'maxcombine'
@ -520,26 +522,26 @@ EXTERN long p_mfd; // 'maxfuncdepth'
EXTERN long p_mmd; // 'maxmapdepth' EXTERN long p_mmd; // 'maxmapdepth'
EXTERN long p_mmp; // 'maxmempattern' EXTERN long p_mmp; // 'maxmempattern'
EXTERN long p_mis; // 'menuitems' EXTERN long p_mis; // 'menuitems'
EXTERN char_u *p_msm; // 'mkspellmem' EXTERN char_u *p_msm; // 'mkspellmem'
EXTERN long p_mle; // 'modelineexpr' EXTERN long p_mle; // 'modelineexpr'
EXTERN long p_mls; // 'modelines' EXTERN long p_mls; // 'modelines'
EXTERN char_u *p_mouse; // 'mouse' EXTERN char_u *p_mouse; // 'mouse'
EXTERN char_u *p_mousem; // 'mousemodel' EXTERN char_u *p_mousem; // 'mousemodel'
EXTERN long p_mousef; // 'mousefocus' EXTERN long p_mousef; // 'mousefocus'
EXTERN long p_mouset; // 'mousetime' EXTERN long p_mouset; // 'mousetime'
EXTERN int p_more; // 'more' EXTERN int p_more; // 'more'
EXTERN char_u *p_opfunc; // 'operatorfunc' EXTERN char_u *p_opfunc; // 'operatorfunc'
EXTERN char_u *p_para; // 'paragraphs' EXTERN char_u *p_para; // 'paragraphs'
EXTERN int p_paste; // 'paste' EXTERN int p_paste; // 'paste'
EXTERN char_u *p_pt; // 'pastetoggle' EXTERN char_u *p_pt; // 'pastetoggle'
EXTERN char_u *p_pex; // 'patchexpr' EXTERN char_u *p_pex; // 'patchexpr'
EXTERN char_u *p_pm; // 'patchmode' EXTERN char_u *p_pm; // 'patchmode'
EXTERN char_u *p_path; // 'path' EXTERN char_u *p_path; // 'path'
EXTERN char_u *p_cdpath; // 'cdpath' EXTERN char_u *p_cdpath; // 'cdpath'
EXTERN long p_pyx; // 'pyxversion' EXTERN long p_pyx; // 'pyxversion'
EXTERN char_u *p_rdb; // 'redrawdebug' EXTERN char_u *p_rdb; // 'redrawdebug'
EXTERN unsigned rdb_flags; EXTERN unsigned rdb_flags;
# ifdef IN_OPTION_C #ifdef IN_OPTION_C
static char *(p_rdb_values[]) = { static char *(p_rdb_values[]) = {
"compositor", "compositor",
"nothrottle", "nothrottle",
@ -547,11 +549,11 @@ static char *(p_rdb_values[]) = {
"nodelta", "nodelta",
NULL NULL
}; };
# endif #endif
# define RDB_COMPOSITOR 0x001 #define RDB_COMPOSITOR 0x001
# define RDB_NOTHROTTLE 0x002 #define RDB_NOTHROTTLE 0x002
# define RDB_INVALID 0x004 #define RDB_INVALID 0x004
# define RDB_NODELTA 0x008 #define RDB_NODELTA 0x008
EXTERN long p_rdt; // 'redrawtime' EXTERN long p_rdt; // 'redrawtime'
EXTERN int p_remap; // 'remap' EXTERN int p_remap; // 'remap'
@ -561,21 +563,21 @@ EXTERN long p_pvh; // 'previewheight'
EXTERN int p_ari; // 'allowrevins' EXTERN int p_ari; // 'allowrevins'
EXTERN int p_ri; // 'revins' EXTERN int p_ri; // 'revins'
EXTERN int p_ru; // 'ruler' EXTERN int p_ru; // 'ruler'
EXTERN char_u *p_ruf; // 'rulerformat' EXTERN char_u *p_ruf; // 'rulerformat'
EXTERN char_u *p_pp; // 'packpath' EXTERN char_u *p_pp; // 'packpath'
EXTERN char_u *p_qftf; // 'quickfixtextfunc' EXTERN char_u *p_qftf; // 'quickfixtextfunc'
EXTERN char_u *p_rtp; // 'runtimepath' EXTERN char_u *p_rtp; // 'runtimepath'
EXTERN long p_scbk; // 'scrollback' EXTERN long p_scbk; // 'scrollback'
EXTERN long p_sj; // 'scrolljump' EXTERN long p_sj; // 'scrolljump'
EXTERN long p_so; // 'scrolloff' EXTERN long p_so; // 'scrolloff'
EXTERN char_u *p_sbo; // 'scrollopt' EXTERN char_u *p_sbo; // 'scrollopt'
EXTERN char_u *p_sections; // 'sections' EXTERN char_u *p_sections; // 'sections'
EXTERN int p_secure; // 'secure' EXTERN int p_secure; // 'secure'
EXTERN char_u *p_sel; // 'selection' EXTERN char_u *p_sel; // 'selection'
EXTERN char_u *p_slm; // 'selectmode' EXTERN char_u *p_slm; // 'selectmode'
EXTERN char_u *p_ssop; // 'sessionoptions' EXTERN char_u *p_ssop; // 'sessionoptions'
EXTERN unsigned ssop_flags; EXTERN unsigned ssop_flags;
# ifdef IN_OPTION_C #ifdef IN_OPTION_C
// Also used for 'viewoptions'! Keep in sync with SSOP_ flags. // Also used for 'viewoptions'! Keep in sync with SSOP_ flags.
static char *(p_ssop_values[]) = { static char *(p_ssop_values[]) = {
"buffers", "winpos", "resize", "winsize", "buffers", "winpos", "resize", "winsize",
@ -583,41 +585,41 @@ static char *(p_ssop_values[]) = {
"sesdir", "curdir", "folds", "cursor", "tabpages", "terminal", "skiprtp", "sesdir", "curdir", "folds", "cursor", "tabpages", "terminal", "skiprtp",
NULL NULL
}; };
# endif #endif
# define SSOP_BUFFERS 0x001 #define SSOP_BUFFERS 0x001
# define SSOP_WINPOS 0x002 #define SSOP_WINPOS 0x002
# define SSOP_RESIZE 0x004 #define SSOP_RESIZE 0x004
# define SSOP_WINSIZE 0x008 #define SSOP_WINSIZE 0x008
# define SSOP_LOCALOPTIONS 0x010 #define SSOP_LOCALOPTIONS 0x010
# define SSOP_OPTIONS 0x020 #define SSOP_OPTIONS 0x020
# define SSOP_HELP 0x040 #define SSOP_HELP 0x040
# define SSOP_BLANK 0x080 #define SSOP_BLANK 0x080
# define SSOP_GLOBALS 0x100 #define SSOP_GLOBALS 0x100
# define SSOP_SLASH 0x200 // Deprecated, always set. #define SSOP_SLASH 0x200 // Deprecated, always set.
# define SSOP_UNIX 0x400 // Deprecated, always set. #define SSOP_UNIX 0x400 // Deprecated, always set.
# define SSOP_SESDIR 0x800 #define SSOP_SESDIR 0x800
# define SSOP_CURDIR 0x1000 #define SSOP_CURDIR 0x1000
# define SSOP_FOLDS 0x2000 #define SSOP_FOLDS 0x2000
# define SSOP_CURSOR 0x4000 #define SSOP_CURSOR 0x4000
# define SSOP_TABPAGES 0x8000 #define SSOP_TABPAGES 0x8000
# define SSOP_TERMINAL 0x10000 #define SSOP_TERMINAL 0x10000
# define SSOP_SKIP_RTP 0x20000 #define SSOP_SKIP_RTP 0x20000
EXTERN char_u *p_sh; // 'shell' EXTERN char_u *p_sh; // 'shell'
EXTERN char_u *p_shcf; // 'shellcmdflag' EXTERN char_u *p_shcf; // 'shellcmdflag'
EXTERN char_u *p_sp; // 'shellpipe' EXTERN char_u *p_sp; // 'shellpipe'
EXTERN char_u *p_shq; // 'shellquote' EXTERN char_u *p_shq; // 'shellquote'
EXTERN char_u *p_sxq; // 'shellxquote' EXTERN char_u *p_sxq; // 'shellxquote'
EXTERN char_u *p_sxe; // 'shellxescape' EXTERN char_u *p_sxe; // 'shellxescape'
EXTERN char_u *p_srr; // 'shellredir' EXTERN char_u *p_srr; // 'shellredir'
EXTERN int p_stmp; // 'shelltemp' EXTERN int p_stmp; // 'shelltemp'
#ifdef BACKSLASH_IN_FILENAME #ifdef BACKSLASH_IN_FILENAME
EXTERN int p_ssl; // 'shellslash' EXTERN int p_ssl; // 'shellslash'
#endif #endif
EXTERN char_u *p_stl; // 'statusline' EXTERN char_u *p_stl; // 'statusline'
EXTERN int p_sr; // 'shiftround' EXTERN int p_sr; // 'shiftround'
EXTERN char_u *p_shm; // 'shortmess' EXTERN char_u *p_shm; // 'shortmess'
EXTERN char_u *p_sbr; // 'showbreak' EXTERN char_u *p_sbr; // 'showbreak'
EXTERN int p_sc; // 'showcmd' EXTERN int p_sc; // 'showcmd'
EXTERN int p_sft; // 'showfulltag' EXTERN int p_sft; // 'showfulltag'
EXTERN int p_sm; // 'showmatch' EXTERN int p_sm; // 'showmatch'
@ -628,29 +630,29 @@ EXTERN int p_scs; // 'smartcase'
EXTERN int p_sta; // 'smarttab' EXTERN int p_sta; // 'smarttab'
EXTERN int p_sb; // 'splitbelow' EXTERN int p_sb; // 'splitbelow'
EXTERN long p_tpm; // 'tabpagemax' EXTERN long p_tpm; // 'tabpagemax'
EXTERN char_u *p_tal; // 'tabline' EXTERN char_u *p_tal; // 'tabline'
EXTERN char_u *p_tpf; // 'termpastefilter' EXTERN char_u *p_tpf; // 'termpastefilter'
EXTERN unsigned int tpf_flags; ///< flags from 'termpastefilter' EXTERN unsigned int tpf_flags; ///< flags from 'termpastefilter'
#ifdef IN_OPTION_C #ifdef IN_OPTION_C
static char *(p_tpf_values[]) = static char *(p_tpf_values[]) =
{ "BS", "HT", "FF", "ESC", "DEL", "C0", "C1", NULL }; { "BS", "HT", "FF", "ESC", "DEL", "C0", "C1", NULL };
#endif #endif
# define TPF_BS 0x001 #define TPF_BS 0x001
# define TPF_HT 0x002 #define TPF_HT 0x002
# define TPF_FF 0x004 #define TPF_FF 0x004
# define TPF_ESC 0x008 #define TPF_ESC 0x008
# define TPF_DEL 0x010 #define TPF_DEL 0x010
# define TPF_C0 0x020 #define TPF_C0 0x020
# define TPF_C1 0x040 #define TPF_C1 0x040
EXTERN char_u *p_sps; // 'spellsuggest' EXTERN char_u *p_sps; // 'spellsuggest'
EXTERN int p_spr; // 'splitright' EXTERN int p_spr; // 'splitright'
EXTERN int p_sol; // 'startofline' EXTERN int p_sol; // 'startofline'
EXTERN char_u *p_su; // 'suffixes' EXTERN char_u *p_su; // 'suffixes'
EXTERN char_u *p_swb; // 'switchbuf' EXTERN char_u *p_swb; // 'switchbuf'
EXTERN unsigned swb_flags; EXTERN unsigned swb_flags;
#ifdef IN_OPTION_C #ifdef IN_OPTION_C
static char *(p_swb_values[]) = static char *(p_swb_values[]) =
{ "useopen", "usetab", "split", "newtab", "vsplit", "uselast", NULL }; { "useopen", "usetab", "split", "newtab", "vsplit", "uselast", NULL };
#endif #endif
#define SWB_USEOPEN 0x001 #define SWB_USEOPEN 0x001
#define SWB_USETAB 0x002 #define SWB_USETAB 0x002
@ -663,7 +665,7 @@ EXTERN char_u *p_tc; ///< 'tagcase'
EXTERN unsigned tc_flags; ///< flags from 'tagcase' EXTERN unsigned tc_flags; ///< flags from 'tagcase'
#ifdef IN_OPTION_C #ifdef IN_OPTION_C
static char *(p_tc_values[]) = static char *(p_tc_values[]) =
{ "followic", "ignore", "match", "followscs", "smart", NULL }; { "followic", "ignore", "match", "followscs", "smart", NULL };
#endif #endif
#define TC_FOLLOWIC 0x01 #define TC_FOLLOWIC 0x01
#define TC_IGNORE 0x02 #define TC_IGNORE 0x02
@ -701,35 +703,35 @@ EXTERN unsigned vop_flags; ///< uses SSOP_ flags
EXTERN int p_vb; ///< 'visualbell' EXTERN int p_vb; ///< 'visualbell'
EXTERN char_u *p_ve; ///< 'virtualedit' EXTERN char_u *p_ve; ///< 'virtualedit'
EXTERN unsigned ve_flags; EXTERN unsigned ve_flags;
# ifdef IN_OPTION_C #ifdef IN_OPTION_C
static char *(p_ve_values[]) = {"block", "insert", "all", "onemore", NULL}; static char *(p_ve_values[]) = { "block", "insert", "all", "onemore", NULL };
# endif #endif
# define VE_BLOCK 5 // includes "all" #define VE_BLOCK 5 // includes "all"
# define VE_INSERT 6 // includes "all" #define VE_INSERT 6 // includes "all"
# define VE_ALL 4 #define VE_ALL 4
# define VE_ONEMORE 8 #define VE_ONEMORE 8
EXTERN long p_verbose; // 'verbose' EXTERN long p_verbose; // 'verbose'
#ifdef IN_OPTION_C #ifdef IN_OPTION_C
char_u *p_vfile = (char_u *)""; // used before options are initialized char_u *p_vfile = (char_u *)""; // used before options are initialized
#else #else
extern char_u *p_vfile; // 'verbosefile' extern char_u *p_vfile; // 'verbosefile'
#endif #endif
EXTERN int p_warn; // 'warn' EXTERN int p_warn; // 'warn'
EXTERN char_u *p_wop; // 'wildoptions' EXTERN char_u *p_wop; // 'wildoptions'
EXTERN unsigned wop_flags; EXTERN unsigned wop_flags;
# ifdef IN_OPTION_C #ifdef IN_OPTION_C
static char *(p_wop_values[]) = { "tagfile", "pum", NULL }; static char *(p_wop_values[]) = { "tagfile", "pum", NULL };
#endif #endif
#define WOP_TAGFILE 0x01 #define WOP_TAGFILE 0x01
#define WOP_PUM 0x02 #define WOP_PUM 0x02
EXTERN long p_window; // 'window' EXTERN long p_window; // 'window'
EXTERN char_u *p_wak; // 'winaltkeys' EXTERN char_u *p_wak; // 'winaltkeys'
EXTERN char_u *p_wig; // 'wildignore' EXTERN char_u *p_wig; // 'wildignore'
EXTERN char_u *p_ww; // 'whichwrap' EXTERN char_u *p_ww; // 'whichwrap'
EXTERN long p_wc; // 'wildchar' EXTERN long p_wc; // 'wildchar'
EXTERN long p_wcm; // 'wildcharm' EXTERN long p_wcm; // 'wildcharm'
EXTERN int p_wic; // 'wildignorecase' EXTERN int p_wic; // 'wildignorecase'
EXTERN char_u *p_wim; // 'wildmode' EXTERN char_u *p_wim; // 'wildmode'
EXTERN int p_wmnu; // 'wildmenu' EXTERN int p_wmnu; // 'wildmenu'
EXTERN long p_wh; // 'winheight' EXTERN long p_wh; // 'winheight'
EXTERN long p_wmh; // 'winminheight' EXTERN long p_wmh; // 'winminheight'

View File

@ -1,8 +1,8 @@
#ifndef NVIM_OS_UNIX_H #ifndef NVIM_OS_UNIX_H
#define NVIM_OS_UNIX_H #define NVIM_OS_UNIX_H
#include "nvim/types.h" // for vim_acl_T
#include "nvim/os/shell.h" #include "nvim/os/shell.h"
#include "nvim/types.h" // for vim_acl_T
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "os_unix.h.generated.h" # include "os_unix.h.generated.h"

View File

@ -2,22 +2,22 @@
#define NVIM_PATH_H #define NVIM_PATH_H
#include "nvim/func_attr.h" #include "nvim/func_attr.h"
#include "nvim/types.h"
#include "nvim/garray.h" #include "nvim/garray.h"
#include "nvim/types.h"
/* Flags for expand_wildcards() */ // Flags for expand_wildcards()
#define EW_DIR 0x01 /* include directory names */ #define EW_DIR 0x01 // include directory names
#define EW_FILE 0x02 /* include file names */ #define EW_FILE 0x02 // include file names
#define EW_NOTFOUND 0x04 /* include not found names */ #define EW_NOTFOUND 0x04 // include not found names
#define EW_ADDSLASH 0x08 /* append slash to directory name */ #define EW_ADDSLASH 0x08 // append slash to directory name
#define EW_KEEPALL 0x10 /* keep all matches */ #define EW_KEEPALL 0x10 // keep all matches
#define EW_SILENT 0x20 /* don't print "1 returned" from shell */ #define EW_SILENT 0x20 // don't print "1 returned" from shell
#define EW_EXEC 0x40 /* executable files */ #define EW_EXEC 0x40 // executable files
#define EW_PATH 0x80 /* search in 'path' too */ #define EW_PATH 0x80 // search in 'path' too
#define EW_ICASE 0x100 /* ignore case */ #define EW_ICASE 0x100 // ignore case
#define EW_NOERROR 0x200 /* no error for bad regexp */ #define EW_NOERROR 0x200 // no error for bad regexp
#define EW_NOTWILD 0x400 /* add match with literal name if exists */ #define EW_NOTWILD 0x400 // add match with literal name if exists
#define EW_KEEPDOLLAR 0x800 /* do not escape $, $var is expanded */ #define EW_KEEPDOLLAR 0x800 // do not escape $, $var is expanded
/* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND /* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND
* is used when executing commands and EW_SILENT for interactive expanding. */ * is used when executing commands and EW_SILENT for interactive expanding. */
#define EW_ALLLINKS 0x1000 // also links not pointing to existing file #define EW_ALLLINKS 0x1000 // also links not pointing to existing file

View File

@ -1,10 +1,10 @@
#ifndef NVIM_POPUPMNU_H #ifndef NVIM_POPUPMNU_H
#define NVIM_POPUPMNU_H #define NVIM_POPUPMNU_H
#include "nvim/vim.h"
#include "nvim/macros.h"
#include "nvim/grid_defs.h" #include "nvim/grid_defs.h"
#include "nvim/macros.h"
#include "nvim/types.h" #include "nvim/types.h"
#include "nvim/vim.h"
/// Used for popup menu items. /// Used for popup menu items.
typedef struct { typedef struct {

View File

@ -26,8 +26,8 @@ enum { MINCOL = 1 };
* position in file or buffer * position in file or buffer
*/ */
typedef struct { typedef struct {
linenr_T lnum; /* line number */ linenr_T lnum; // line number
colnr_T col; /* column number */ colnr_T col; // column number
colnr_T coladd; colnr_T coladd;
} pos_T; } pos_T;
@ -36,8 +36,8 @@ typedef struct {
* Same, but without coladd. * Same, but without coladd.
*/ */
typedef struct { typedef struct {
linenr_T lnum; /* line number */ linenr_T lnum; // line number
colnr_T col; /* column number */ colnr_T col; // column number
} lpos_T; } lpos_T;
#endif // NVIM_POS_H #endif // NVIM_POS_H

View File

@ -7,8 +7,8 @@
typedef uint64_t proftime_T; typedef uint64_t proftime_T;
#define TIME_MSG(s) do { \ #define TIME_MSG(s) do { \
if (time_fd != NULL) time_msg(s, NULL); \ if (time_fd != NULL) time_msg(s, NULL); \
} while (0) } while (0)
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "profile.h.generated.h" # include "profile.h.generated.h"

View File

@ -1,10 +1,10 @@
#ifndef NVIM_QUICKFIX_H #ifndef NVIM_QUICKFIX_H
#define NVIM_QUICKFIX_H #define NVIM_QUICKFIX_H
#include "nvim/types.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/types.h"
/* flags for skip_vimgrep_pat() */ // flags for skip_vimgrep_pat()
#define VGR_GLOBAL 1 #define VGR_GLOBAL 1
#define VGR_NOJUMP 2 #define VGR_NOJUMP 2

View File

@ -38,17 +38,17 @@
// create infinite loops // create infinite loops
#define RBUFFER_UNTIL_EMPTY(buf, rptr, rcnt) \ #define RBUFFER_UNTIL_EMPTY(buf, rptr, rcnt) \
for (size_t rcnt = 0, _r = 1; _r; _r = 0) /* NOLINT(readability/braces) */ \ for (size_t rcnt = 0, _r = 1; _r; _r = 0) /* NOLINT(readability/braces) */ \
for ( /* NOLINT(readability/braces) */ \ for ( /* NOLINT(readability/braces) */ \
char *rptr = rbuffer_read_ptr(buf, &rcnt); \ char *rptr = rbuffer_read_ptr(buf, &rcnt); \
buf->size; \ buf->size; \
rptr = rbuffer_read_ptr(buf, &rcnt)) rptr = rbuffer_read_ptr(buf, &rcnt))
#define RBUFFER_UNTIL_FULL(buf, wptr, wcnt) \ #define RBUFFER_UNTIL_FULL(buf, wptr, wcnt) \
for (size_t wcnt = 0, _r = 1; _r; _r = 0) /* NOLINT(readability/braces) */ \ for (size_t wcnt = 0, _r = 1; _r; _r = 0) /* NOLINT(readability/braces) */ \
for ( /* NOLINT(readability/braces) */ \ for ( /* NOLINT(readability/braces) */ \
char *wptr = rbuffer_write_ptr(buf, &wcnt); \ char *wptr = rbuffer_write_ptr(buf, &wcnt); \
rbuffer_space(buf); \ rbuffer_space(buf); \
wptr = rbuffer_write_ptr(buf, &wcnt)) wptr = rbuffer_write_ptr(buf, &wcnt))
// Iteration // Iteration
@ -56,23 +56,23 @@
for (size_t i = 0; /* NOLINT(readability/braces) */ \ for (size_t i = 0; /* NOLINT(readability/braces) */ \
i < buf->size; \ i < buf->size; \
i = buf->size) \ i = buf->size) \
for (char c = 0; /* NOLINT(readability/braces) */ \ for (char c = 0; /* NOLINT(readability/braces) */ \
i < buf->size ? ((int)(c = *rbuffer_get(buf, i))) || 1 : 0; \ i < buf->size ? ((int)(c = *rbuffer_get(buf, i))) || 1 : 0; \
i++) i++)
#define RBUFFER_EACH_REVERSE(buf, c, i) \ #define RBUFFER_EACH_REVERSE(buf, c, i) \
for (size_t i = buf->size; /* NOLINT(readability/braces) */ \ for (size_t i = buf->size; /* NOLINT(readability/braces) */ \
i != SIZE_MAX; \ i != SIZE_MAX; \
i = SIZE_MAX) \ i = SIZE_MAX) \
for (char c = 0; /* NOLINT(readability/braces) */ \ for (char c = 0; /* NOLINT(readability/braces) */ \
i-- > 0 ? ((int)(c = *rbuffer_get(buf, i))) || 1 : 0; \ i-- > 0 ? ((int)(c = *rbuffer_get(buf, i))) || 1 : 0; \
) )
typedef struct rbuffer RBuffer; typedef struct rbuffer RBuffer;
/// Type of function invoked during certain events: /// Type of function invoked during certain events:
/// - When the RBuffer switches to the full state /// - When the RBuffer switches to the full state
/// - When the RBuffer switches to the non-full state /// - When the RBuffer switches to the non-full state
typedef void(*rbuffer_callback)(RBuffer *buf, void *data); typedef void (*rbuffer_callback)(RBuffer *buf, void *data);
struct rbuffer { struct rbuffer {
rbuffer_callback full_cb, nonfull_cb; rbuffer_callback full_cb, nonfull_cb;

View File

@ -1,6 +1,8 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check // This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// uncrustify:off
/* /*
* Handling of regular expressions: vim_regcomp(), vim_regexec(), vim_regsub() * Handling of regular expressions: vim_regcomp(), vim_regexec(), vim_regsub()
* *

View File

@ -1,9 +1,9 @@
#ifndef NVIM_REGEXP_H #ifndef NVIM_REGEXP_H
#define NVIM_REGEXP_H #define NVIM_REGEXP_H
#include "nvim/types.h"
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/regexp_defs.h" #include "nvim/regexp_defs.h"
#include "nvim/types.h"
// Second argument for vim_regcomp(). // Second argument for vim_regcomp().
#define RE_MAGIC 1 ///< 'magic' option #define RE_MAGIC 1 ///< 'magic' option

View File

@ -15,8 +15,8 @@
#include <stdbool.h> #include <stdbool.h>
#include "nvim/pos.h" #include "nvim/pos.h"
#include "nvim/types.h"
#include "nvim/profile.h" #include "nvim/profile.h"
#include "nvim/types.h"
/* /*
* The number of sub-matches is limited to 10. * The number of sub-matches is limited to 10.
@ -53,7 +53,7 @@ typedef struct reg_extmatch reg_extmatch_T;
/// always 0. /// always 0.
/// When there is no match, the line number is -1. /// When there is no match, the line number is -1.
typedef struct { typedef struct {
regprog_T *regprog; regprog_T *regprog;
lpos_T startpos[NSUBEXP]; lpos_T startpos[NSUBEXP];
lpos_T endpos[NSUBEXP]; lpos_T endpos[NSUBEXP];
int rmm_ic; int rmm_ic;
@ -90,7 +90,7 @@ typedef struct {
int regstart; int regstart;
char_u reganch; char_u reganch;
char_u *regmust; char_u *regmust;
int regmlen; int regmlen;
char_u reghasz; char_u reghasz;
char_u program[1]; // actually longer.. char_u program[1]; // actually longer..
@ -101,8 +101,8 @@ typedef struct {
typedef struct nfa_state nfa_state_T; typedef struct nfa_state nfa_state_T;
struct nfa_state { struct nfa_state {
int c; int c;
nfa_state_T *out; nfa_state_T *out;
nfa_state_T *out1; nfa_state_T *out1;
int id; int id;
int lastlist[2]; // 0: normal, 1: recursive int lastlist[2]; // 0: normal, 1: recursive
int val; int val;
@ -119,16 +119,16 @@ typedef struct {
unsigned re_flags; unsigned re_flags;
bool re_in_use; bool re_in_use;
nfa_state_T *start; // points into state[] nfa_state_T *start; // points into state[]
int reganch; // pattern starts with ^ int reganch; // pattern starts with ^
int regstart; // char at start of pattern int regstart; // char at start of pattern
char_u *match_text; // plain text to match with char_u *match_text; // plain text to match with
int has_zend; // pattern contains \ze int has_zend; // pattern contains \ze
int has_backref; // pattern contains \1 .. \9 int has_backref; // pattern contains \1 .. \9
int reghasz; int reghasz;
char_u *pattern; char_u *pattern;
int nsubexp; // number of () int nsubexp; // number of ()
int nstate; int nstate;
nfa_state_T state[1]; // actually longer.. nfa_state_T state[1]; // actually longer..
@ -140,10 +140,10 @@ typedef struct {
* When there is no match, the pointer is NULL. * When there is no match, the pointer is NULL.
*/ */
typedef struct { typedef struct {
regprog_T *regprog; regprog_T *regprog;
char_u *startp[NSUBEXP]; char_u *startp[NSUBEXP];
char_u *endp[NSUBEXP]; char_u *endp[NSUBEXP];
bool rm_ic; bool rm_ic;
} regmatch_T; } regmatch_T;
/* /*
@ -153,16 +153,16 @@ typedef struct {
*/ */
struct reg_extmatch { struct reg_extmatch {
int16_t refcnt; int16_t refcnt;
char_u *matches[NSUBEXP]; char_u *matches[NSUBEXP];
}; };
struct regengine { struct regengine {
regprog_T *(*regcomp)(char_u *, int); regprog_T *(*regcomp)(char_u *, int);
void (*regfree)(regprog_T *); void (*regfree)(regprog_T *);
int (*regexec_nl)(regmatch_T *, char_u *, colnr_T, bool); int (*regexec_nl)(regmatch_T *, char_u *, colnr_T, bool);
long (*regexec_multi)(regmmatch_T *, win_T *, buf_T *, linenr_T, colnr_T, long (*regexec_multi)(regmmatch_T *, win_T *, buf_T *, linenr_T, colnr_T,
proftime_T *, int *); proftime_T *, int *);
char_u *expr; char_u *expr;
}; };
#endif // NVIM_REGEXP_DEFS_H #endif // NVIM_REGEXP_DEFS_H

View File

@ -1,6 +1,8 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check // This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// uncrustify:off
/* /*
* NFA regular expression implementation. * NFA regular expression implementation.
* *

View File

@ -3,10 +3,10 @@
#include <stdbool.h> #include <stdbool.h>
#include "nvim/types.h"
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/grid_defs.h" #include "nvim/grid_defs.h"
#include "nvim/pos.h" #include "nvim/pos.h"
#include "nvim/types.h"
/* /*
* flags for update_screen() * flags for update_screen()
@ -14,12 +14,12 @@
*/ */
#define VALID 10 /* buffer not changed, or changes marked #define VALID 10 /* buffer not changed, or changes marked
with b_mod_* */ with b_mod_* */
#define INVERTED 20 /* redisplay inverted part that changed */ #define INVERTED 20 // redisplay inverted part that changed
#define INVERTED_ALL 25 /* redisplay whole inverted part */ #define INVERTED_ALL 25 // redisplay whole inverted part
#define REDRAW_TOP 30 /* display first w_upd_rows screen lines */ #define REDRAW_TOP 30 // display first w_upd_rows screen lines
#define SOME_VALID 35 /* like NOT_VALID but may scroll */ #define SOME_VALID 35 // like NOT_VALID but may scroll
#define NOT_VALID 40 /* buffer needs complete redraw */ #define NOT_VALID 40 // buffer needs complete redraw
#define CLEAR 50 /* screen messed up, clear it */ #define CLEAR 50 // screen messed up, clear it
/// By default, all widows are draw on a single rectangular grid, represented by /// By default, all widows are draw on a single rectangular grid, represented by
/// this ScreenGrid instance. In multigrid mode each window will have its own /// this ScreenGrid instance. In multigrid mode each window will have its own

View File

@ -4,14 +4,14 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include "nvim/vim.h"
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/eval/funcs.h" #include "nvim/eval/funcs.h"
#include "nvim/eval/typval.h" #include "nvim/eval/typval.h"
#include "nvim/normal.h" #include "nvim/normal.h"
#include "nvim/os/time.h" #include "nvim/os/time.h"
#include "nvim/vim.h"
/* Values for the find_pattern_in_path() function args 'type' and 'action': */ // Values for the find_pattern_in_path() function args 'type' and 'action':
#define FIND_ANY 1 #define FIND_ANY 1
#define FIND_DEFINE 2 #define FIND_DEFINE 2
#define CHECK_PATH 3 #define CHECK_PATH 3
@ -37,18 +37,18 @@
#define SEARCH_PEEK 0x800 ///< peek for typed char, cancel search #define SEARCH_PEEK 0x800 ///< peek for typed char, cancel search
#define SEARCH_COL 0x1000 ///< start at specified column instead of zero #define SEARCH_COL 0x1000 ///< start at specified column instead of zero
/* Values for flags argument for findmatchlimit() */ // Values for flags argument for findmatchlimit()
#define FM_BACKWARD 0x01 /* search backwards */ #define FM_BACKWARD 0x01 // search backwards
#define FM_FORWARD 0x02 /* search forwards */ #define FM_FORWARD 0x02 // search forwards
#define FM_BLOCKSTOP 0x04 /* stop at start/end of block */ #define FM_BLOCKSTOP 0x04 // stop at start/end of block
#define FM_SKIPCOMM 0x08 /* skip comments */ #define FM_SKIPCOMM 0x08 // skip comments
/* Values for sub_cmd and which_pat argument for search_regcomp() */ // Values for sub_cmd and which_pat argument for search_regcomp()
/* Also used for which_pat argument for searchit() */ // Also used for which_pat argument for searchit()
#define RE_SEARCH 0 /* save/use pat in/from search_pattern */ #define RE_SEARCH 0 // save/use pat in/from search_pattern
#define RE_SUBST 1 /* save/use pat in/from subst_pattern */ #define RE_SUBST 1 // save/use pat in/from subst_pattern
#define RE_BOTH 2 /* save pat in both patterns */ #define RE_BOTH 2 // save pat in both patterns
#define RE_LAST 2 /* use last used pattern if "pat" is NULL */ #define RE_LAST 2 // use last used pattern if "pat" is NULL
// Values for searchcount() // Values for searchcount()
#define SEARCH_STAT_DEF_TIMEOUT 40L #define SEARCH_STAT_DEF_TIMEOUT 40L
@ -78,21 +78,21 @@ typedef struct spat {
/// Optional extra arguments for searchit(). /// Optional extra arguments for searchit().
typedef struct { typedef struct {
linenr_T sa_stop_lnum; ///< stop after this line number when != 0 linenr_T sa_stop_lnum; ///< stop after this line number when != 0
proftime_T *sa_tm; ///< timeout limit or NULL proftime_T *sa_tm; ///< timeout limit or NULL
int sa_timed_out; ///< set when timed out int sa_timed_out; ///< set when timed out
int sa_wrapped; ///< search wrapped around int sa_wrapped; ///< search wrapped around
} searchit_arg_T; } searchit_arg_T;
typedef struct searchstat typedef struct searchstat
{ {
int cur; // current position of found words int cur; // current position of found words
int cnt; // total count of found words int cnt; // total count of found words
bool exact_match; // true if matched exactly on specified position bool exact_match; // true if matched exactly on specified position
int incomplete; // 0: search was fully completed int incomplete; // 0: search was fully completed
// 1: recomputing was timed out // 1: recomputing was timed out
// 2: max count exceeded // 2: max count exceeded
int last_maxcount; // the max count of the last search int last_maxcount; // the max count of the last search
} searchstat_T; } searchstat_T;
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS

View File

@ -1,8 +1,8 @@
#ifndef NVIM_SHA256_H #ifndef NVIM_SHA256_H
#define NVIM_SHA256_H #define NVIM_SHA256_H
#include <stdint.h> // for uint32_t
#include <stddef.h> #include <stddef.h>
#include <stdint.h> // for uint32_t
#include "nvim/types.h" // for char_u #include "nvim/types.h" // for char_u

View File

@ -2,6 +2,7 @@
#define NVIM_SIGN_H #define NVIM_SIGN_H
#include <stdbool.h> #include <stdbool.h>
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/sign_defs.h" #include "nvim/sign_defs.h"

View File

@ -2,6 +2,7 @@
#define NVIM_SIGN_DEFS_H #define NVIM_SIGN_DEFS_H
#include <stdbool.h> #include <stdbool.h>
#include "nvim/pos.h" #include "nvim/pos.h"
#include "nvim/types.h" #include "nvim/types.h"
@ -10,9 +11,9 @@
// Sign group // Sign group
typedef struct signgroup_S typedef struct signgroup_S
{ {
uint16_t sg_refcount; // number of signs in this group uint16_t sg_refcount; // number of signs in this group
int sg_next_sign_id; // next sign id for this group int sg_next_sign_id; // next sign id for this group
char_u sg_name[1]; // sign group name char_u sg_name[1]; // sign group name
} signgroup_T; } signgroup_T;
// Macros to get the sign group structure from the group name // Macros to get the sign group structure from the group name
@ -22,23 +23,23 @@ typedef struct signgroup_S
typedef struct sign_entry sign_entry_T; typedef struct sign_entry sign_entry_T;
struct sign_entry { struct sign_entry {
int se_id; // unique identifier for each placed sign int se_id; // unique identifier for each placed sign
int se_typenr; // typenr of sign int se_typenr; // typenr of sign
int se_priority; // priority for highlighting int se_priority; // priority for highlighting
bool se_has_text_or_icon; // has text or icon bool se_has_text_or_icon; // has text or icon
linenr_T se_lnum; // line number which has this sign linenr_T se_lnum; // line number which has this sign
signgroup_T *se_group; // sign group signgroup_T *se_group; // sign group
sign_entry_T *se_next; // next entry in a list of signs sign_entry_T *se_next; // next entry in a list of signs
sign_entry_T *se_prev; // previous entry -- for easy reordering sign_entry_T *se_prev; // previous entry -- for easy reordering
}; };
/// Sign attributes. Used by the screen refresh routines. /// Sign attributes. Used by the screen refresh routines.
typedef struct sign_attrs_S { typedef struct sign_attrs_S {
int sat_typenr; int sat_typenr;
char_u *sat_text; char_u *sat_text;
int sat_texthl; int sat_texthl;
int sat_linehl; int sat_linehl;
int sat_numhl; int sat_numhl;
} sign_attrs_T; } sign_attrs_T;
#define SIGN_SHOW_MAX 9 #define SIGN_SHOW_MAX 9

View File

@ -3,9 +3,9 @@
#include <stdbool.h> #include <stdbool.h>
#include "nvim/spell_defs.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/globals.h" #include "nvim/globals.h"
#include "nvim/spell_defs.h"
#include "nvim/vim.h" #include "nvim/vim.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS

View File

@ -20,9 +20,9 @@
// is 8 bytes we could use something smaller, but what? // is 8 bytes we could use something smaller, but what?
typedef int idx_T; typedef int idx_T;
# define SPL_FNAME_TMPL "%s.%s.spl" #define SPL_FNAME_TMPL "%s.%s.spl"
# define SPL_FNAME_ADD ".add." #define SPL_FNAME_ADD ".add."
# define SPL_FNAME_ASCII ".ascii." #define SPL_FNAME_ASCII ".ascii."
// Flags used for a word. Only the lowest byte can be used, the region byte // Flags used for a word. Only the lowest byte can be used, the region byte
// comes above it. // comes above it.
@ -71,22 +71,22 @@ typedef int idx_T;
// si_repsal, sl_rep, and si_sal. Not for sl_sal! // si_repsal, sl_rep, and si_sal. Not for sl_sal!
// One replacement: from "ft_from" to "ft_to". // One replacement: from "ft_from" to "ft_to".
typedef struct fromto_S { typedef struct fromto_S {
char_u *ft_from; char_u *ft_from;
char_u *ft_to; char_u *ft_to;
} fromto_T; } fromto_T;
// Info from "SAL" entries in ".aff" file used in sl_sal. // Info from "SAL" entries in ".aff" file used in sl_sal.
// The info is split for quick processing by spell_soundfold(). // The info is split for quick processing by spell_soundfold().
// Note that "sm_oneof" and "sm_rules" point into sm_lead. // Note that "sm_oneof" and "sm_rules" point into sm_lead.
typedef struct salitem_S { typedef struct salitem_S {
char_u *sm_lead; // leading letters char_u *sm_lead; // leading letters
int sm_leadlen; // length of "sm_lead" int sm_leadlen; // length of "sm_lead"
char_u *sm_oneof; // letters from () or NULL char_u *sm_oneof; // letters from () or NULL
char_u *sm_rules; // rules like ^, $, priority char_u *sm_rules; // rules like ^, $, priority
char_u *sm_to; // replacement. char_u *sm_to; // replacement.
int *sm_lead_w; // wide character copy of "sm_lead" int *sm_lead_w; // wide character copy of "sm_lead"
int *sm_oneof_w; // wide character copy of "sm_oneof" int *sm_oneof_w; // wide character copy of "sm_oneof"
int *sm_to_w; // wide character copy of "sm_to" int *sm_to_w; // wide character copy of "sm_to"
} salitem_T; } salitem_T;
typedef int salfirst_T; typedef int salfirst_T;
@ -113,25 +113,25 @@ typedef int salfirst_T;
typedef struct slang_S slang_T; typedef struct slang_S slang_T;
struct slang_S { struct slang_S {
slang_T *sl_next; // next language slang_T *sl_next; // next language
char_u *sl_name; // language name "en", "en.rare", "nl", etc. char_u *sl_name; // language name "en", "en.rare", "nl", etc.
char_u *sl_fname; // name of .spl file char_u *sl_fname; // name of .spl file
bool sl_add; // true if it's a .add file. bool sl_add; // true if it's a .add file.
char_u *sl_fbyts; // case-folded word bytes char_u *sl_fbyts; // case-folded word bytes
long sl_fbyts_len; // length of sl_fbyts long sl_fbyts_len; // length of sl_fbyts
idx_T *sl_fidxs; // case-folded word indexes idx_T *sl_fidxs; // case-folded word indexes
char_u *sl_kbyts; // keep-case word bytes char_u *sl_kbyts; // keep-case word bytes
idx_T *sl_kidxs; // keep-case word indexes idx_T *sl_kidxs; // keep-case word indexes
char_u *sl_pbyts; // prefix tree word bytes char_u *sl_pbyts; // prefix tree word bytes
idx_T *sl_pidxs; // prefix tree word indexes idx_T *sl_pidxs; // prefix tree word indexes
char_u *sl_info; // infotext string or NULL char_u *sl_info; // infotext string or NULL
char_u sl_regions[MAXREGIONS * 2 + 1]; char_u sl_regions[MAXREGIONS * 2 + 1];
// table with up to 8 region names plus NUL // table with up to 8 region names plus NUL
char_u *sl_midword; // MIDWORD string or NULL char_u *sl_midword; // MIDWORD string or NULL
hashtab_T sl_wordcount; // hashtable with word count, wordcount_T hashtab_T sl_wordcount; // hashtable with word count, wordcount_T
@ -140,17 +140,17 @@ struct slang_S {
int sl_compsylmax; // COMPOUNDSYLMAX (default: MAXWLEN) int sl_compsylmax; // COMPOUNDSYLMAX (default: MAXWLEN)
int sl_compoptions; // COMP_* flags int sl_compoptions; // COMP_* flags
garray_T sl_comppat; // CHECKCOMPOUNDPATTERN items garray_T sl_comppat; // CHECKCOMPOUNDPATTERN items
regprog_T *sl_compprog; // COMPOUNDRULE turned into a regexp progrm regprog_T *sl_compprog; // COMPOUNDRULE turned into a regexp progrm
// (NULL when no compounding) // (NULL when no compounding)
char_u *sl_comprules; // all COMPOUNDRULE concatenated (or NULL) char_u *sl_comprules; // all COMPOUNDRULE concatenated (or NULL)
char_u *sl_compstartflags; // flags for first compound word char_u *sl_compstartflags; // flags for first compound word
char_u *sl_compallflags; // all flags for compound words char_u *sl_compallflags; // all flags for compound words
bool sl_nobreak; // When true: no spaces between words bool sl_nobreak; // When true: no spaces between words
char_u *sl_syllable; // SYLLABLE repeatable chars or NULL char_u *sl_syllable; // SYLLABLE repeatable chars or NULL
garray_T sl_syl_items; // syllable items garray_T sl_syl_items; // syllable items
int sl_prefixcnt; // number of items in "sl_prefprog" int sl_prefixcnt; // number of items in "sl_prefprog"
regprog_T **sl_prefprog; // table with regprogs for prefixes regprog_T **sl_prefprog; // table with regprogs for prefixes
garray_T sl_rep; // list of fromto_T entries from REP lines garray_T sl_rep; // list of fromto_T entries from REP lines
int16_t sl_rep_first[256]; // indexes where byte first appears, -1 if int16_t sl_rep_first[256]; // indexes where byte first appears, -1 if
@ -171,9 +171,9 @@ struct slang_S {
// Info from the .sug file. Loaded on demand. // Info from the .sug file. Loaded on demand.
time_t sl_sugtime; // timestamp for .sug file time_t sl_sugtime; // timestamp for .sug file
char_u *sl_sbyts; // soundfolded word bytes char_u *sl_sbyts; // soundfolded word bytes
idx_T *sl_sidxs; // soundfolded word indexes idx_T *sl_sidxs; // soundfolded word indexes
buf_T *sl_sugbuf; // buffer with word number table buf_T *sl_sugbuf; // buffer with word number table
bool sl_sugloaded; // true when .sug file was loaded or failed to bool sl_sugloaded; // true when .sug file was loaded or failed to
// load // load
@ -186,9 +186,9 @@ struct slang_S {
// Structure used in "b_langp", filled from 'spelllang'. // Structure used in "b_langp", filled from 'spelllang'.
typedef struct langp_S { typedef struct langp_S {
slang_T *lp_slang; // info for this language slang_T *lp_slang; // info for this language
slang_T *lp_sallang; // language used for sound folding or NULL slang_T *lp_sallang; // language used for sound folding or NULL
slang_T *lp_replang; // language used for REP items or NULL slang_T *lp_replang; // language used for REP items or NULL
int lp_region; // bitmask for region or REGION_ALL int lp_region; // bitmask for region or REGION_ALL
} langp_T; } langp_T;
@ -268,7 +268,7 @@ typedef struct trystate_S {
#define SPELL_TOFOLD(c) ((c) >= 128 ? utf_fold(c) : (int)spelltab.st_fold[c]) #define SPELL_TOFOLD(c) ((c) >= 128 ? utf_fold(c) : (int)spelltab.st_fold[c])
#define SPELL_TOUPPER(c) ((c) >= 128 ? mb_toupper(c) \ #define SPELL_TOUPPER(c) ((c) >= 128 ? mb_toupper(c) \
: (int)spelltab.st_upper[c]) : (int)spelltab.st_upper[c])
#define SPELL_ISUPPER(c) ((c) >= 128 ? mb_isupper(c) : spelltab.st_isu[c]) #define SPELL_ISUPPER(c) ((c) >= 128 ? mb_isupper(c) : spelltab.st_isu[c])

View File

@ -3,9 +3,9 @@
#include <stdbool.h> #include <stdbool.h>
#include "nvim/ex_cmds_defs.h"
#include "nvim/spell_defs.h" #include "nvim/spell_defs.h"
#include "nvim/types.h" #include "nvim/types.h"
#include "nvim/ex_cmds_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "spellfile.h.generated.h" # include "spellfile.h.generated.h"

View File

@ -5,8 +5,8 @@
typedef struct vim_state VimState; typedef struct vim_state VimState;
typedef int(*state_check_callback)(VimState *state); typedef int (*state_check_callback)(VimState *state);
typedef int(*state_execute_callback)(VimState *state, int key); typedef int (*state_execute_callback)(VimState *state, int key);
struct vim_state { struct vim_state {
state_check_callback check; state_check_callback check;

View File

@ -1,12 +1,12 @@
#ifndef NVIM_STRINGS_H #ifndef NVIM_STRINGS_H
#define NVIM_STRINGS_H #define NVIM_STRINGS_H
#include <stdbool.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdbool.h>
#include <string.h> #include <string.h>
#include "nvim/types.h"
#include "nvim/eval/typval.h" #include "nvim/eval/typval.h"
#include "nvim/types.h"
/// Append string to string and return pointer to the next byte /// Append string to string and return pointer to the next byte
/// ///

View File

@ -3,29 +3,29 @@
#include <stdbool.h> #include <stdbool.h>
#include "nvim/globals.h"
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/globals.h"
#define HL_CONTAINED 0x01 /* not used on toplevel */ #define HL_CONTAINED 0x01 // not used on toplevel
#define HL_TRANSP 0x02 /* has no highlighting */ #define HL_TRANSP 0x02 // has no highlighting
#define HL_ONELINE 0x04 /* match within one line only */ #define HL_ONELINE 0x04 // match within one line only
#define HL_HAS_EOL 0x08 /* end pattern that matches with $ */ #define HL_HAS_EOL 0x08 // end pattern that matches with $
#define HL_SYNC_HERE 0x10 /* sync point after this item (syncing only) */ #define HL_SYNC_HERE 0x10 // sync point after this item (syncing only)
#define HL_SYNC_THERE 0x20 /* sync point at current line (syncing only) */ #define HL_SYNC_THERE 0x20 // sync point at current line (syncing only)
#define HL_MATCH 0x40 /* use match ID instead of item ID */ #define HL_MATCH 0x40 // use match ID instead of item ID
#define HL_SKIPNL 0x80 /* nextgroup can skip newlines */ #define HL_SKIPNL 0x80 // nextgroup can skip newlines
#define HL_SKIPWHITE 0x100 /* nextgroup can skip white space */ #define HL_SKIPWHITE 0x100 // nextgroup can skip white space
#define HL_SKIPEMPTY 0x200 /* nextgroup can skip empty lines */ #define HL_SKIPEMPTY 0x200 // nextgroup can skip empty lines
#define HL_KEEPEND 0x400 /* end match always kept */ #define HL_KEEPEND 0x400 // end match always kept
#define HL_EXCLUDENL 0x800 /* exclude NL from match */ #define HL_EXCLUDENL 0x800 // exclude NL from match
#define HL_DISPLAY 0x1000 /* only used for displaying, not syncing */ #define HL_DISPLAY 0x1000 // only used for displaying, not syncing
#define HL_FOLD 0x2000 /* define fold */ #define HL_FOLD 0x2000 // define fold
#define HL_EXTEND 0x4000 /* ignore a keepend */ #define HL_EXTEND 0x4000 // ignore a keepend
#define HL_MATCHCONT 0x8000 /* match continued from previous line */ #define HL_MATCHCONT 0x8000 // match continued from previous line
#define HL_TRANS_CONT 0x10000 /* transparent item without contains arg */ #define HL_TRANS_CONT 0x10000 // transparent item without contains arg
#define HL_CONCEAL 0x20000 /* can be concealed */ #define HL_CONCEAL 0x20000 // can be concealed
#define HL_CONCEALENDS 0x40000 /* can be concealed */ #define HL_CONCEALENDS 0x40000 // can be concealed
#define SYN_GROUP_STATIC(s) syn_check_group((char_u *)S_LEN(s)) #define SYN_GROUP_STATIC(s) syn_check_group((char_u *)S_LEN(s))

View File

@ -3,18 +3,18 @@
#include "nvim/highlight_defs.h" #include "nvim/highlight_defs.h"
# define SST_MIN_ENTRIES 150 /* minimal size for state stack array */ #define SST_MIN_ENTRIES 150 // minimal size for state stack array
# define SST_MAX_ENTRIES 1000 /* maximal size for state stack array */ #define SST_MAX_ENTRIES 1000 // maximal size for state stack array
# define SST_FIX_STATES 7 /* size of sst_stack[]. */ #define SST_FIX_STATES 7 // size of sst_stack[].
# define SST_DIST 16 /* normal distance between entries */ #define SST_DIST 16 // normal distance between entries
# define SST_INVALID (synstate_T *)-1 /* invalid syn_state pointer */ #define SST_INVALID (synstate_T *)-1 // invalid syn_state pointer
typedef struct syn_state synstate_T; typedef struct syn_state synstate_T;
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
#include "nvim/regexp_defs.h" #include "nvim/regexp_defs.h"
/* struct passed to in_id_list() */ // struct passed to in_id_list()
struct sp_syn { struct sp_syn {
int inc_tag; // ":syn include" unique tag int inc_tag; // ":syn include" unique tag
int16_t id; // highlight group ID of item int16_t id; // highlight group ID of item
@ -27,7 +27,7 @@ struct sp_syn {
typedef struct keyentry keyentry_T; typedef struct keyentry keyentry_T;
struct keyentry { struct keyentry {
keyentry_T *ke_next; // next entry with identical "keyword[]" keyentry_T *ke_next; // next entry with identical "keyword[]"
struct sp_syn k_syn; // struct passed to in_id_list() struct sp_syn k_syn; // struct passed to in_id_list()
int16_t *next_list; // ID list for next match (if non-zero) int16_t *next_list; // ID list for next match (if non-zero)
int flags; int flags;
@ -39,11 +39,11 @@ struct keyentry {
* Struct used to store one state of the state stack. * Struct used to store one state of the state stack.
*/ */
typedef struct buf_state { typedef struct buf_state {
int bs_idx; /* index of pattern */ int bs_idx; // index of pattern
int bs_flags; /* flags for pattern */ int bs_flags; // flags for pattern
int bs_seqnr; /* stores si_seqnr */ int bs_seqnr; // stores si_seqnr
int bs_cchar; /* stores si_cchar */ int bs_cchar; // stores si_cchar
reg_extmatch_T *bs_extmatch; /* external matches from start pattern */ reg_extmatch_T *bs_extmatch; // external matches from start pattern
} bufstate_T; } bufstate_T;
/* /*
@ -51,11 +51,11 @@ typedef struct buf_state {
* Used by b_sst_array[]. * Used by b_sst_array[].
*/ */
struct syn_state { struct syn_state {
synstate_T *sst_next; /* next entry in used or free list */ synstate_T *sst_next; // next entry in used or free list
linenr_T sst_lnum; /* line number for this state */ linenr_T sst_lnum; // line number for this state
union { union {
bufstate_T sst_stack[SST_FIX_STATES]; /* short state stack */ bufstate_T sst_stack[SST_FIX_STATES]; // short state stack
garray_T sst_ga; /* growarray for long state stack */ garray_T sst_ga; // growarray for long state stack
} sst_union; } sst_union;
int sst_next_flags; // flags for sst_next_list int sst_next_flags; // flags for sst_next_list
int sst_stacksize; // number of states on the stack int sst_stacksize; // number of states on the stack

View File

@ -1,24 +1,24 @@
#ifndef NVIM_TAG_H #ifndef NVIM_TAG_H
#define NVIM_TAG_H #define NVIM_TAG_H
#include "nvim/types.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/types.h"
/* /*
* Values for do_tag(). * Values for do_tag().
*/ */
#define DT_TAG 1 /* jump to newer position or same tag again */ #define DT_TAG 1 // jump to newer position or same tag again
#define DT_POP 2 /* jump to older position */ #define DT_POP 2 // jump to older position
#define DT_NEXT 3 /* jump to next match of same tag */ #define DT_NEXT 3 // jump to next match of same tag
#define DT_PREV 4 /* jump to previous match of same tag */ #define DT_PREV 4 // jump to previous match of same tag
#define DT_FIRST 5 /* jump to first match of same tag */ #define DT_FIRST 5 // jump to first match of same tag
#define DT_LAST 6 /* jump to first match of same tag */ #define DT_LAST 6 // jump to first match of same tag
#define DT_SELECT 7 /* jump to selection from list */ #define DT_SELECT 7 // jump to selection from list
#define DT_HELP 8 /* like DT_TAG, but no wildcards */ #define DT_HELP 8 // like DT_TAG, but no wildcards
#define DT_JUMP 9 /* jump to new tag or selection from list */ #define DT_JUMP 9 // jump to new tag or selection from list
#define DT_CSCOPE 10 /* cscope find command (like tjump) */ #define DT_CSCOPE 10 // cscope find command (like tjump)
#define DT_LTAG 11 /* tag using location list */ #define DT_LTAG 11 // tag using location list
#define DT_FREE 99 /* free cached matches */ #define DT_FREE 99 // free cached matches
// //
// flags for find_tags(). // flags for find_tags().
@ -40,11 +40,11 @@
* Structure used for get_tagfname(). * Structure used for get_tagfname().
*/ */
typedef struct { typedef struct {
char_u *tn_tags; /* value of 'tags' when starting */ char_u *tn_tags; // value of 'tags' when starting
char_u *tn_np; /* current position in tn_tags */ char_u *tn_np; // current position in tn_tags
int tn_did_filefind_init; int tn_did_filefind_init;
int tn_hf_idx; int tn_hf_idx;
void *tn_search_ctx; void *tn_search_ctx;
} tagname_T; } tagname_T;

View File

@ -1,8 +1,8 @@
#ifndef NVIM_TERMINAL_H #ifndef NVIM_TERMINAL_H
#define NVIM_TERMINAL_H #define NVIM_TERMINAL_H
#include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
typedef struct terminal Terminal; typedef struct terminal Terminal;

View File

@ -1,6 +1,8 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check // This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// uncrustify:off
/* vi:set ts=8 sts=4 sw=4 noet: /* vi:set ts=8 sts=4 sw=4 noet:
* *
* VIM - Vi IMproved by Bram Moolenaar * VIM - Vi IMproved by Bram Moolenaar

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,8 @@
#ifndef NVIM_TYPES_H #ifndef NVIM_TYPES_H
#define NVIM_TYPES_H #define NVIM_TYPES_H
#include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
// dummy to pass an ACL to a function // dummy to pass an ACL to a function
typedef void *vim_acl_T; typedef void *vim_acl_T;

Some files were not shown because too many files have changed in this diff Show More