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
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;

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"

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

@@ -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

@@ -68,15 +68,15 @@
# 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 \
@@ -89,7 +89,7 @@
# 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

View File

@@ -1,15 +1,15 @@
#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 {
@@ -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);

View File

@@ -111,9 +111,8 @@ 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
/* /*
@@ -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;
/* /*
@@ -310,7 +309,7 @@ typedef struct argentry {
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)
@@ -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;
@@ -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
/* /*
@@ -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
@@ -925,8 +924,8 @@ struct diffblock_S {
}; };
#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",
@@ -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

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
/// ///

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

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

@@ -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 {

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.
@@ -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

@@ -3,13 +3,13 @@
#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

@@ -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,15 +169,15 @@ 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
@@ -420,18 +420,18 @@ EXTERN int updating_screen INIT(= 0);
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)
@@ -452,7 +452,7 @@ 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.
@@ -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
]; ];
@@ -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,14 +846,15 @@ 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(=
N_(
"E11: Invalid in command-line window; <CR> executes, CTRL-C quits")); "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"));
EXTERN char_u e_curdir[] INIT(= N_( EXTERN char_u e_curdir[] INIT(=
N_(
"E12: Command not allowed from exrc/vimrc in current dir or tag search")); "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"));
@@ -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,15 +880,13 @@ 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()\""));
@@ -896,8 +894,7 @@ 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,56 +959,44 @@ 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_( EXTERN char_u e_cmdmap_key[] INIT(=N_("E5522: <Cmd> mapping must not include %s key"));
"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(=
N_(
"E1155: Cannot define autocommands for ALL events")); "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"));

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.
@@ -46,7 +46,7 @@ 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

@@ -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

@@ -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

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

@@ -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

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) \
@@ -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; \
@@ -204,11 +204,11 @@
/// ///
#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 \
@@ -218,11 +218,11 @@
_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 \

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,16 +1,16 @@
#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/mark_defs.h"
#include "nvim/extmark_defs.h"
#include "nvim/memory.h"
#include "nvim/pos.h"
#include "nvim/os/time.h"
#include "nvim/ex_cmds_defs.h" // for exarg_T #include "nvim/ex_cmds_defs.h" // for exarg_T
#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/os/time.h"
#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_) \

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

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/types.h"
#include "nvim/pos.h" // for pos_T, linenr_T, colnr_T
#include "nvim/buffer_defs.h" // for buf_T #include "nvim/buffer_defs.h" // for buf_T
#include "nvim/pos.h" // for pos_T, linenr_T, colnr_T
#include "nvim/types.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "memline.h.generated.h" # include "memline.h.generated.h"

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

@@ -3,8 +3,8 @@
#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/os/time.h"
#include "nvim/normal.h" // for MotionType and oparg_T
#include "nvim/ex_cmds_defs.h" // for exarg_T #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/types.h"
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"
@@ -49,10 +51,10 @@
// 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
@@ -181,7 +183,7 @@ enum {
#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
@@ -273,7 +275,7 @@ enum {
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
@@ -316,25 +318,25 @@ 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
@@ -361,11 +363,11 @@ 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'
@@ -373,19 +375,19 @@ 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'
@@ -393,8 +395,8 @@ 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'
@@ -437,22 +439,22 @@ 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'
@@ -539,7 +541,7 @@ 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'
@@ -575,7 +577,7 @@ 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,25 +585,25 @@ 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'
@@ -633,15 +635,15 @@ 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'
@@ -650,7 +652,7 @@ 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,13 +703,13 @@ 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
@@ -717,7 +719,7 @@ extern char_u *p_vfile; // 'verbosefile'
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

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

@@ -8,7 +8,7 @@ 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

@@ -72,7 +72,7 @@ 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.

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

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"

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.

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
@@ -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,8 +40,8 @@
* 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;

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;

View File

@@ -1,8 +1,8 @@
#ifndef NVIM_UGRID_H #ifndef NVIM_UGRID_H
#define NVIM_UGRID_H #define NVIM_UGRID_H
#include "nvim/ui.h"
#include "nvim/globals.h" #include "nvim/globals.h"
#include "nvim/ui.h"
typedef struct ucell UCell; typedef struct ucell UCell;
typedef struct ugrid UGrid; typedef struct ugrid UGrid;

View File

@@ -1,12 +1,12 @@
#ifndef NVIM_UI_H #ifndef NVIM_UI_H
#define NVIM_UI_H #define NVIM_UI_H
#include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "nvim/globals.h"
#include "nvim/api/private/defs.h" #include "nvim/api/private/defs.h"
#include "nvim/globals.h"
#include "nvim/highlight_defs.h" #include "nvim/highlight_defs.h"
typedef enum { typedef enum {
@@ -70,6 +70,7 @@ struct ui_t {
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ui.h.generated.h" # include "ui.h.generated.h"
# include "ui_events_call.h.generated.h" # include "ui_events_call.h.generated.h"
#endif #endif

View File

@@ -5,11 +5,11 @@
#include <uv.h> #include <uv.h>
#include "nvim/ui.h"
#include "nvim/event/defs.h" #include "nvim/event/defs.h"
#include "nvim/ui.h"
typedef struct ui_bridge_data UIBridgeData; typedef struct ui_bridge_data UIBridgeData;
typedef void(*ui_main_fn)(UIBridgeData *bridge, UI *ui); typedef void (*ui_main_fn)(UIBridgeData *bridge, UI *ui);
struct ui_bridge_data { struct ui_bridge_data {
UI bridge; // actual UI passed to ui_attach UI bridge; // actual UI passed to ui_attach
UI *ui; // UI pointer that will have its callback called in UI *ui; // UI pointer that will have its callback called in

View File

@@ -1,8 +1,8 @@
#ifndef NVIM_UI_COMPOSITOR_H #ifndef NVIM_UI_COMPOSITOR_H
#define NVIM_UI_COMPOSITOR_H #define NVIM_UI_COMPOSITOR_H
#include "nvim/ui.h"
#include "nvim/event/defs.h" #include "nvim/event/defs.h"
#include "nvim/ui.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ui_compositor.h.generated.h" # include "ui_compositor.h.generated.h"

View File

@@ -1,8 +1,8 @@
#ifndef NVIM_UNDO_H #ifndef NVIM_UNDO_H
#define NVIM_UNDO_H #define NVIM_UNDO_H
#include "nvim/undo_defs.h"
#include "nvim/ex_cmds_defs.h" #include "nvim/ex_cmds_defs.h"
#include "nvim/undo_defs.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "undo.h.generated.h" # include "undo.h.generated.h"

View File

@@ -3,32 +3,32 @@
#include <time.h> // for time_t #include <time.h> // for time_t
#include "nvim/pos.h"
#include "nvim/extmark_defs.h" #include "nvim/extmark_defs.h"
#include "nvim/mark_defs.h" #include "nvim/mark_defs.h"
#include "nvim/pos.h"
typedef struct u_header u_header_T; typedef struct u_header u_header_T;
/* Structure to store info about the Visual area. */ // Structure to store info about the Visual area.
typedef struct { typedef struct {
pos_T vi_start; /* start pos of last VIsual */ pos_T vi_start; // start pos of last VIsual
pos_T vi_end; /* end position of last VIsual */ pos_T vi_end; // end position of last VIsual
int vi_mode; /* VIsual_mode of last VIsual */ int vi_mode; // VIsual_mode of last VIsual
colnr_T vi_curswant; /* MAXCOL from w_curswant */ colnr_T vi_curswant; // MAXCOL from w_curswant
} visualinfo_T; } visualinfo_T;
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
typedef struct u_entry u_entry_T; typedef struct u_entry u_entry_T;
struct u_entry { struct u_entry {
u_entry_T *ue_next; /* pointer to next entry in list */ u_entry_T *ue_next; // pointer to next entry in list
linenr_T ue_top; /* number of line above undo block */ linenr_T ue_top; // number of line above undo block
linenr_T ue_bot; /* number of line below undo block */ linenr_T ue_bot; // number of line below undo block
linenr_T ue_lcount; /* linecount when u_save called */ linenr_T ue_lcount; // linecount when u_save called
char_u **ue_array; /* array of lines in undo block */ char_u **ue_array; // array of lines in undo block
long ue_size; /* number of lines in ue_array */ long ue_size; // number of lines in ue_array
#ifdef U_DEBUG #ifdef U_DEBUG
int ue_magic; /* magic number to check allocation */ int ue_magic; // magic number to check allocation
#endif #endif
}; };
@@ -36,26 +36,26 @@ struct u_header {
/* The following have a pointer and a number. The number is used when /* The following have a pointer and a number. The number is used when
* reading the undo file in u_read_undo() */ * reading the undo file in u_read_undo() */
union { union {
u_header_T *ptr; /* pointer to next undo header in list */ u_header_T *ptr; // pointer to next undo header in list
long seq; long seq;
} uh_next; } uh_next;
union { union {
u_header_T *ptr; /* pointer to previous header in list */ u_header_T *ptr; // pointer to previous header in list
long seq; long seq;
} uh_prev; } uh_prev;
union { union {
u_header_T *ptr; /* pointer to next header for alt. redo */ u_header_T *ptr; // pointer to next header for alt. redo
long seq; long seq;
} uh_alt_next; } uh_alt_next;
union { union {
u_header_T *ptr; /* pointer to previous header for alt. redo */ u_header_T *ptr; // pointer to previous header for alt. redo
long seq; long seq;
} uh_alt_prev; } uh_alt_prev;
long uh_seq; /* sequence number, higher == newer undo */ long uh_seq; // sequence number, higher == newer undo
int uh_walk; /* used by undo_time() */ int uh_walk; // used by undo_time()
u_entry_T *uh_entry; /* pointer to first entry */ u_entry_T *uh_entry; // pointer to first entry
u_entry_T *uh_getbot_entry; /* pointer to where ue_bot must be set */ u_entry_T *uh_getbot_entry; // pointer to where ue_bot must be set
pos_T uh_cursor; /* cursor position before saving */ pos_T uh_cursor; // cursor position before saving
long uh_cursor_vcol; long uh_cursor_vcol;
int uh_flags; // see below int uh_flags; // see below
fmark_T uh_namedm[NMARKS]; // marks before undo/after redo fmark_T uh_namedm[NMARKS]; // marks before undo/after redo

View File

@@ -5,8 +5,8 @@
#include "nvim/macros.h" #include "nvim/macros.h"
// defined in version.c // defined in version.c
extern char* Version; extern char * Version;
extern char* longVersion; extern char * longVersion;
// //
// Vim version number, name, etc. Patchlevel is defined in version.c. // Vim version number, name, etc. Patchlevel is defined in version.c.

View File

@@ -1,8 +1,8 @@
#ifndef NVIM_VIM_H #ifndef NVIM_VIM_H
#define NVIM_VIM_H #define NVIM_VIM_H
#include "nvim/types.h"
#include "nvim/pos.h" // for linenr_T, MAXCOL, etc... #include "nvim/pos.h" // for linenr_T, MAXCOL, etc...
#include "nvim/types.h"
// Some defines from the old feature.h // Some defines from the old feature.h
#define SESSION_FILE "Session.vim" #define SESSION_FILE "Session.vim"
@@ -30,11 +30,10 @@ enum { NUMBUFLEN = 65 };
#define ROOT_UID 0 #define ROOT_UID 0
#include "nvim/gettext.h"
#include "nvim/keymap.h" #include "nvim/keymap.h"
#include "nvim/macros.h" #include "nvim/macros.h"
#include "nvim/gettext.h"
// special attribute addition: Put message in history // special attribute addition: Put message in history
#define MSG_HIST 0x1000 #define MSG_HIST 0x1000
@@ -57,8 +56,8 @@ enum { NUMBUFLEN = 65 };
#define REPLACE_FLAG 0x40 // Replace mode flag #define REPLACE_FLAG 0x40 // Replace mode flag
#define REPLACE (REPLACE_FLAG + INSERT) #define REPLACE (REPLACE_FLAG + INSERT)
# define VREPLACE_FLAG 0x80 // Virtual-replace mode flag #define VREPLACE_FLAG 0x80 // Virtual-replace mode flag
# define VREPLACE (REPLACE_FLAG + VREPLACE_FLAG + INSERT) #define VREPLACE (REPLACE_FLAG + VREPLACE_FLAG + INSERT)
#define LREPLACE (REPLACE_FLAG + LANGMAP) #define LREPLACE (REPLACE_FLAG + LANGMAP)
#define NORMAL_BUSY (0x100 + NORMAL) // Normal mode, busy with a command #define NORMAL_BUSY (0x100 + NORMAL) // Normal mode, busy with a command
@@ -251,7 +250,7 @@ enum { FOLD_TEXT_LEN = 51 }; //!< buffer size for get_foldtext()
#define STRNCAT(d, s, n) strncat((char *)(d), (char *)(s), (size_t)(n)) #define STRNCAT(d, s, n) strncat((char *)(d), (char *)(s), (size_t)(n))
#define STRLCAT(d, s, n) xstrlcat((char *)(d), (char *)(s), (size_t)(n)) #define STRLCAT(d, s, n) xstrlcat((char *)(d), (char *)(s), (size_t)(n))
# define vim_strpbrk(s, cs) (char_u *)strpbrk((char *)(s), (char *)(cs)) #define vim_strpbrk(s, cs) (char_u *)strpbrk((char *)(s), (char *)(cs))
// Character used as separated in autoload function/variable names. // Character used as separated in autoload function/variable names.
#define AUTOLOAD_CHAR '#' #define AUTOLOAD_CHAR '#'
@@ -260,7 +259,7 @@ enum { FOLD_TEXT_LEN = 51 }; //!< buffer size for get_foldtext()
// Prefer using emsgf(), because perror() may send the output to the wrong // Prefer using emsgf(), because perror() may send the output to the wrong
// destination and mess up the screen. // destination and mess up the screen.
#define PERROR(msg) (void) emsgf("%s: %s", msg, strerror(errno)) #define PERROR(msg) (void)emsgf("%s: %s", msg, strerror(errno))
#define SHOWCMD_COLS 10 // columns needed by shown command #define SHOWCMD_COLS 10 // columns needed by shown command
@@ -301,9 +300,9 @@ enum { FOLD_TEXT_LEN = 51 }; //!< buffer size for get_foldtext()
# define mch_msg(str) printf("%s", (str)) # define mch_msg(str) printf("%s", (str))
#endif #endif
#include "nvim/globals.h" // global variables and messages
#include "nvim/buffer_defs.h" // buffer and windows #include "nvim/buffer_defs.h" // buffer and windows
#include "nvim/ex_cmds_defs.h" // Ex command defines #include "nvim/ex_cmds_defs.h" // Ex command defines
#include "nvim/globals.h" // global variables and messages
// Lowest number used for window ID. Cannot have this many windows per tab. // Lowest number used for window ID. Cannot have this many windows per tab.
#define LOWEST_WIN_ID 1000 #define LOWEST_WIN_ID 1000

View File

@@ -5,11 +5,11 @@
#include "nvim/buffer_defs.h" #include "nvim/buffer_defs.h"
/* Values for file_name_in_line() */ // Values for file_name_in_line()
#define FNAME_MESS 1 /* give error message */ #define FNAME_MESS 1 // give error message
#define FNAME_EXP 2 /* expand to path */ #define FNAME_EXP 2 // expand to path
#define FNAME_HYP 4 /* check for hypertext link */ #define FNAME_HYP 4 // check for hypertext link
#define FNAME_INCL 8 /* apply 'includeexpr' */ #define FNAME_INCL 8 // apply 'includeexpr'
#define FNAME_REL 16 /* ".." and "./" are relative to the (current) #define FNAME_REL 16 /* ".." and "./" are relative to the (current)
file instead of the current directory */ file instead of the current directory */
#define FNAME_UNESC 32 // remove backslashes used for escaping #define FNAME_UNESC 32 // remove backslashes used for escaping
@@ -17,20 +17,20 @@
/* /*
* arguments for win_split() * arguments for win_split()
*/ */
#define WSP_ROOM 1 /* require enough room */ #define WSP_ROOM 1 // require enough room
#define WSP_VERT 2 /* split vertically */ #define WSP_VERT 2 // split vertically
#define WSP_TOP 4 /* window at top-left of shell */ #define WSP_TOP 4 // window at top-left of shell
#define WSP_BOT 8 /* window at bottom-right of shell */ #define WSP_BOT 8 // window at bottom-right of shell
#define WSP_HELP 16 /* creating the help window */ #define WSP_HELP 16 // creating the help window
#define WSP_BELOW 32 /* put new window below/right */ #define WSP_BELOW 32 // put new window below/right
#define WSP_ABOVE 64 /* put new window above/left */ #define WSP_ABOVE 64 // put new window above/left
#define WSP_NEWLOC 128 /* don't copy location list */ #define WSP_NEWLOC 128 // don't copy location list
/* /*
* Minimum screen size * Minimum screen size
*/ */
#define MIN_COLUMNS 12 /* minimal columns for screen */ #define MIN_COLUMNS 12 // minimal columns for screen
#define MIN_LINES 2 /* minimal lines for screen */ #define MIN_LINES 2 // minimal lines for screen
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "window.h.generated.h" # include "window.h.generated.h"

View File

@@ -1,4 +1,4 @@
# Uncrustify-0.73.0-199-0dfafb273 # Uncrustify-0.73.0-199-0dfafb27
# #
# General options # General options