mirror of https://github.com/vim/vim.git
patch 8.1.2045: the option.c file is too big
Problem: The option.c file is too big. Solution: Split off the code dealing with strings. (Yegappan Lakshmanan, closes #4937)
This commit is contained in:
parent
8aeec40207
commit
dac1347b4d
2
Filelist
2
Filelist
|
@ -88,6 +88,7 @@ SRC_ALL = \
|
|||
src/option.c \
|
||||
src/option.h \
|
||||
src/optiondefs.h \
|
||||
src/optionstr.c \
|
||||
src/popupmnu.c \
|
||||
src/popupwin.c \
|
||||
src/profiler.c \
|
||||
|
@ -231,6 +232,7 @@ SRC_ALL = \
|
|||
src/proto/normal.pro \
|
||||
src/proto/ops.pro \
|
||||
src/proto/option.pro \
|
||||
src/proto/optionstr.pro \
|
||||
src/proto/popupmnu.pro \
|
||||
src/proto/popupwin.pro \
|
||||
src/proto/profiler.pro \
|
||||
|
|
|
@ -757,6 +757,7 @@ OBJ = \
|
|||
$(OUTDIR)/normal.o \
|
||||
$(OUTDIR)/ops.o \
|
||||
$(OUTDIR)/option.o \
|
||||
$(OUTDIR)/optionstr.o \
|
||||
$(OUTDIR)/os_mswin.o \
|
||||
$(OUTDIR)/os_win32.o \
|
||||
$(OUTDIR)/pathdef.o \
|
||||
|
|
|
@ -76,6 +76,7 @@ SRC = arabic.c \
|
|||
normal.c \
|
||||
ops.c \
|
||||
option.c \
|
||||
optionstr.c \
|
||||
os_amiga.c \
|
||||
popupmnu.c \
|
||||
profiler.c \
|
||||
|
|
|
@ -764,6 +764,7 @@ OBJ = \
|
|||
$(OUTDIR)\normal.obj \
|
||||
$(OUTDIR)\ops.obj \
|
||||
$(OUTDIR)\option.obj \
|
||||
$(OUTDIR)\optionstr.obj \
|
||||
$(OUTDIR)\os_mswin.obj \
|
||||
$(OUTDIR)\os_win32.obj \
|
||||
$(OUTDIR)\pathdef.obj \
|
||||
|
@ -1606,6 +1607,8 @@ $(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
|
|||
|
||||
$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL) optiondefs.h
|
||||
|
||||
$(OUTDIR)/optionstr.obj: $(OUTDIR) optionstr.c $(INCL)
|
||||
|
||||
$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
|
||||
|
||||
$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
|
||||
|
@ -1816,6 +1819,7 @@ proto.h: \
|
|||
proto/normal.pro \
|
||||
proto/ops.pro \
|
||||
proto/option.pro \
|
||||
proto/optionstr.pro \
|
||||
proto/os_mswin.pro \
|
||||
proto/winclip.pro \
|
||||
proto/os_win32.pro \
|
||||
|
|
|
@ -317,8 +317,8 @@ SRC = arabic.c arglist.c autocmd.c beval.c blob.c blowfish.c buffer.c \
|
|||
getchar.c hardcopy.c hashtab.c highlight.c \
|
||||
indent.c insexpand.c json.c list.c main.c map.c mark.c menu.c mbyte.c \
|
||||
memfile.c memline.c message.c misc1.c misc2.c move.c normal.c ops.c \
|
||||
option.c popupmnu.c popupwin.c profiler.c quickfix.c regexp.c \
|
||||
scriptfile.c \
|
||||
option.c optionstr.c popupmnu.c popupwin.c profiler.c quickfix.c \
|
||||
regexp.c scriptfile.c \
|
||||
search.c session.c sha256.c sign.c spell.c spellfile.c syntax.c tag.c \
|
||||
term.c termlib.c testing.c textprop.c ui.c undo.c usercmd.c \
|
||||
userfunc.c version.c viminfo.c screen.c window.c os_unix.c os_vms.c \
|
||||
|
@ -337,8 +337,8 @@ OBJ = arabic.obj arglist.obj autocmd.obj beval.obj blob.obj blowfish.obj \
|
|||
highlight.obj indent.obj insexpand.obj json.obj list.obj main.obj \
|
||||
map.obj mark.obj menu.obj memfile.obj memline.obj message.obj \
|
||||
misc1.obj misc2.obj move.obj mbyte.obj normal.obj ops.obj option.obj \
|
||||
popupmnu.obj popupwin.obj profiler.obj quickfix.obj regexp.obj \
|
||||
scriptfile.obj \
|
||||
optionstr.obj popupmnu.obj popupwin.obj profiler.obj quickfix.obj \
|
||||
regexp.obj scriptfile.obj \
|
||||
search.obj session.obj sha256.obj sign.obj spell.obj spellfile.obj \
|
||||
syntax.obj tag.obj term.obj termlib.obj testing.obj textprop.obj \
|
||||
ui.obj undo.obj usercmd.obj userfunc.obj screen.obj version.obj \
|
||||
|
@ -715,6 +715,10 @@ option.obj : option.c vim.h [.auto]config.h feature.h os_unix.h \
|
|||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
globals.h optiondefs.h
|
||||
optionstr.obj : optionstr.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
globals.h
|
||||
os_unix.obj : os_unix.c vim.h [.auto]config.h feature.h os_unix.h \
|
||||
ascii.h keymap.h term.h macros.h structs.h regexp.h \
|
||||
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
|
||||
|
|
10
src/Makefile
10
src/Makefile
|
@ -1632,6 +1632,7 @@ BASIC_SRC = \
|
|||
normal.c \
|
||||
ops.c \
|
||||
option.c \
|
||||
optionstr.c \
|
||||
os_unix.c \
|
||||
auto/pathdef.c \
|
||||
popupmnu.c \
|
||||
|
@ -1762,6 +1763,7 @@ OBJ_COMMON = \
|
|||
objects/normal.o \
|
||||
objects/ops.o \
|
||||
objects/option.o \
|
||||
objects/optionstr.o \
|
||||
objects/os_unix.o \
|
||||
objects/pathdef.o \
|
||||
objects/popupmnu.o \
|
||||
|
@ -1917,6 +1919,7 @@ PRO_AUTO = \
|
|||
normal.pro \
|
||||
ops.pro \
|
||||
option.pro \
|
||||
optionstr.pro \
|
||||
os_mac_conv.pro \
|
||||
os_unix.pro \
|
||||
popupmnu.pro \
|
||||
|
@ -3287,6 +3290,9 @@ objects/ops.o: ops.c
|
|||
objects/option.o: option.c optiondefs.h
|
||||
$(CCC_NF) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ option.c
|
||||
|
||||
objects/optionstr.o: optionstr.c
|
||||
$(CCC_NF) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) $(RUBY_CFLAGS) $(TCL_CFLAGS) $(ALL_CFLAGS) -o $@ optionstr.c
|
||||
|
||||
objects/os_beos.o: os_beos.c
|
||||
$(CCC) -o $@ os_beos.c
|
||||
|
||||
|
@ -3763,6 +3769,10 @@ objects/option.o: option.c vim.h protodef.h auto/config.h feature.h os_unix.h \
|
|||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h globals.h optiondefs.h
|
||||
objects/optionstr.o: optionstr.c vim.h protodef.h auto/config.h feature.h os_unix.h \
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
proto.h globals.h
|
||||
objects/os_unix.o: os_unix.c vim.h protodef.h auto/config.h feature.h os_unix.h \
|
||||
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
|
||||
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
|
||||
|
|
|
@ -54,6 +54,7 @@ menu.c | menus
|
|||
message.c | (error) messages
|
||||
ops.c | handling operators ("d", "y", "p")
|
||||
option.c | options
|
||||
optionstr.c | handling string options
|
||||
popupmnu.c | popup menu
|
||||
popupwin.c | popup window
|
||||
profiler.c | vim script profiler
|
||||
|
|
52
src/ops.c
52
src/ops.c
|
@ -315,14 +315,14 @@ shift_line(
|
|||
{
|
||||
int count;
|
||||
int i, j;
|
||||
int p_sw = (int)get_sw_value_indent(curbuf);
|
||||
int sw_val = (int)get_sw_value_indent(curbuf);
|
||||
|
||||
count = get_indent(); /* get current indent */
|
||||
|
||||
if (round) /* round off indent */
|
||||
{
|
||||
i = count / p_sw; /* number of p_sw rounded down */
|
||||
j = count % p_sw; /* extra spaces */
|
||||
i = count / sw_val; /* number of p_sw rounded down */
|
||||
j = count % sw_val; /* extra spaces */
|
||||
if (j && left) /* first remove extra spaces */
|
||||
--amount;
|
||||
if (left)
|
||||
|
@ -333,18 +333,18 @@ shift_line(
|
|||
}
|
||||
else
|
||||
i += amount;
|
||||
count = i * p_sw;
|
||||
count = i * sw_val;
|
||||
}
|
||||
else /* original vi indent */
|
||||
{
|
||||
if (left)
|
||||
{
|
||||
count -= p_sw * amount;
|
||||
count -= sw_val * amount;
|
||||
if (count < 0)
|
||||
count = 0;
|
||||
}
|
||||
else
|
||||
count += p_sw * amount;
|
||||
count += sw_val * amount;
|
||||
}
|
||||
|
||||
/* Set new indent */
|
||||
|
@ -366,11 +366,8 @@ shift_block(oparg_T *oap, int amount)
|
|||
int total;
|
||||
char_u *newp, *oldp;
|
||||
int oldcol = curwin->w_cursor.col;
|
||||
int p_sw = (int)get_sw_value_indent(curbuf);
|
||||
#ifdef FEAT_VARTABS
|
||||
int *p_vts = curbuf->b_p_vts_array;
|
||||
#endif
|
||||
int p_ts = (int)curbuf->b_p_ts;
|
||||
int sw_val = (int)get_sw_value_indent(curbuf);
|
||||
int ts_val = (int)curbuf->b_p_ts;
|
||||
struct block_def bd;
|
||||
int incr;
|
||||
colnr_T ws_vcol;
|
||||
|
@ -388,8 +385,8 @@ shift_block(oparg_T *oap, int amount)
|
|||
return;
|
||||
|
||||
/* total is number of screen columns to be inserted/removed */
|
||||
total = (int)((unsigned)amount * (unsigned)p_sw);
|
||||
if ((total / p_sw) != amount)
|
||||
total = (int)((unsigned)amount * (unsigned)sw_val);
|
||||
if ((total / sw_val) != amount)
|
||||
return; /* multiplication overflow */
|
||||
|
||||
oldp = ml_get_curline();
|
||||
|
@ -431,14 +428,15 @@ shift_block(oparg_T *oap, int amount)
|
|||
* non-ws char in the block. */
|
||||
#ifdef FEAT_VARTABS
|
||||
if (!curbuf->b_p_et)
|
||||
tabstop_fromto(ws_vcol, ws_vcol + total, p_ts, p_vts, &i, &j);
|
||||
tabstop_fromto(ws_vcol, ws_vcol + total,
|
||||
ts_val, curbuf->b_p_vts_array, &i, &j);
|
||||
else
|
||||
j = total;
|
||||
#else
|
||||
if (!curbuf->b_p_et)
|
||||
i = ((ws_vcol % p_ts) + total) / p_ts; /* number of tabs */
|
||||
i = ((ws_vcol % ts_val) + total) / ts_val; /* number of tabs */
|
||||
if (i)
|
||||
j = ((ws_vcol % p_ts) + total) % p_ts; /* number of spp */
|
||||
j = ((ws_vcol % ts_val) + total) % ts_val; /* number of spp */
|
||||
else
|
||||
j = total;
|
||||
#endif
|
||||
|
@ -567,7 +565,7 @@ block_insert(
|
|||
int b_insert,
|
||||
struct block_def *bdp)
|
||||
{
|
||||
int p_ts;
|
||||
int ts_val;
|
||||
int count = 0; /* extra spaces to replace a cut TAB */
|
||||
int spaces = 0; /* non-zero if cutting a TAB */
|
||||
colnr_T offset; /* pointer along new line */
|
||||
|
@ -589,20 +587,20 @@ block_insert(
|
|||
|
||||
if (b_insert)
|
||||
{
|
||||
p_ts = bdp->start_char_vcols;
|
||||
ts_val = bdp->start_char_vcols;
|
||||
spaces = bdp->startspaces;
|
||||
if (spaces != 0)
|
||||
count = p_ts - 1; /* we're cutting a TAB */
|
||||
count = ts_val - 1; /* we're cutting a TAB */
|
||||
offset = bdp->textcol;
|
||||
}
|
||||
else /* append */
|
||||
{
|
||||
p_ts = bdp->end_char_vcols;
|
||||
ts_val = bdp->end_char_vcols;
|
||||
if (!bdp->is_short) /* spaces = padding after block */
|
||||
{
|
||||
spaces = (bdp->endspaces ? p_ts - bdp->endspaces : 0);
|
||||
spaces = (bdp->endspaces ? ts_val - bdp->endspaces : 0);
|
||||
if (spaces != 0)
|
||||
count = p_ts - 1; /* we're cutting a TAB */
|
||||
count = ts_val - 1; /* we're cutting a TAB */
|
||||
offset = bdp->textcol + bdp->textlen - (spaces != 0);
|
||||
}
|
||||
else /* spaces = padding to block edge */
|
||||
|
@ -651,7 +649,7 @@ block_insert(
|
|||
if (spaces && !bdp->is_short)
|
||||
{
|
||||
/* insert post-padding */
|
||||
vim_memset(newp + offset + spaces, ' ', (size_t)(p_ts - spaces));
|
||||
vim_memset(newp + offset + spaces, ' ', (size_t)(ts_val - spaces));
|
||||
/* We're splitting a TAB, don't copy it. */
|
||||
oldp++;
|
||||
/* We allowed for that TAB, remember this now */
|
||||
|
@ -5591,10 +5589,10 @@ do_addsub(
|
|||
pos_T startpos;
|
||||
pos_T endpos;
|
||||
|
||||
dohex = (vim_strchr(curbuf->b_p_nf, 'x') != NULL); /* "heX" */
|
||||
dooct = (vim_strchr(curbuf->b_p_nf, 'o') != NULL); /* "Octal" */
|
||||
dobin = (vim_strchr(curbuf->b_p_nf, 'b') != NULL); /* "Bin" */
|
||||
doalp = (vim_strchr(curbuf->b_p_nf, 'p') != NULL); /* "alPha" */
|
||||
dohex = (vim_strchr(curbuf->b_p_nf, 'x') != NULL); // "heX"
|
||||
dooct = (vim_strchr(curbuf->b_p_nf, 'o') != NULL); // "Octal"
|
||||
dobin = (vim_strchr(curbuf->b_p_nf, 'b') != NULL); // "Bin"
|
||||
doalp = (vim_strchr(curbuf->b_p_nf, 'p') != NULL); // "alPha"
|
||||
|
||||
curwin->w_cursor = *pos;
|
||||
ptr = ml_get(pos->lnum);
|
||||
|
|
2599
src/option.c
2599
src/option.c
File diff suppressed because it is too large
Load Diff
203
src/option.h
203
src/option.h
|
@ -10,6 +10,53 @@
|
|||
* option.h: definition of global variables for settable options
|
||||
*/
|
||||
|
||||
//
|
||||
// Flags
|
||||
//
|
||||
#define P_BOOL 0x01 // the option is boolean
|
||||
#define P_NUM 0x02 // the option is numeric
|
||||
#define P_STRING 0x04 // the option is a string
|
||||
#define P_ALLOCED 0x08 // the string option is in allocated memory,
|
||||
// must use free_string_option() when
|
||||
// assigning new value. Not set if default is
|
||||
// the same.
|
||||
#define P_EXPAND 0x10 // environment expansion. NOTE: P_EXPAND can
|
||||
// never be used for local or hidden options!
|
||||
#define P_NODEFAULT 0x40 // don't set to default value
|
||||
#define P_DEF_ALLOCED 0x80 // default value is in allocated memory, must
|
||||
// use vim_free() when assigning new value
|
||||
#define P_WAS_SET 0x100 // option has been set/reset
|
||||
#define P_NO_MKRC 0x200 // don't include in :mkvimrc output
|
||||
#define P_VI_DEF 0x400 // Use Vi default for Vim
|
||||
#define P_VIM 0x800 // Vim option, reset when 'cp' set
|
||||
|
||||
// when option changed, what to display:
|
||||
#define P_RSTAT 0x1000 // redraw status lines
|
||||
#define P_RWIN 0x2000 // redraw current window and recompute text
|
||||
#define P_RBUF 0x4000 // redraw current buffer and recompute text
|
||||
#define P_RALL 0x6000 // redraw all windows
|
||||
#define P_RCLR 0x7000 // clear and redraw all
|
||||
|
||||
#define P_COMMA 0x8000 // comma separated list
|
||||
#define P_ONECOMMA 0x18000L // P_COMMA and cannot have two consecutive
|
||||
// commas
|
||||
#define P_NODUP 0x20000L // don't allow duplicate strings
|
||||
#define P_FLAGLIST 0x40000L // list of single-char flags
|
||||
|
||||
#define P_SECURE 0x80000L // cannot change in modeline or secure mode
|
||||
#define P_GETTEXT 0x100000L // expand default value with _()
|
||||
#define P_NOGLOB 0x200000L // do not use local value for global vimrc
|
||||
#define P_NFNAME 0x400000L // only normal file name chars allowed
|
||||
#define P_INSECURE 0x800000L // option was set from a modeline
|
||||
#define P_PRI_MKRC 0x1000000L // priority for :mkvimrc (setting option has
|
||||
// side effects)
|
||||
#define P_NO_ML 0x2000000L // not allowed in modeline
|
||||
#define P_CURSWANT 0x4000000L // update curswant required; not needed when
|
||||
// there is a redraw flag
|
||||
#define P_NDNAME 0x8000000L // only normal dir name chars allowed
|
||||
#define P_RWINONLY 0x10000000L // only redraw current window
|
||||
#define P_MLE 0x20000000L // under control of 'modelineexpr'
|
||||
|
||||
/*
|
||||
* Default values for 'errorformat'.
|
||||
* The "%f|%l| %m" one is used for when the contents of the quickfix window is
|
||||
|
@ -311,11 +358,26 @@
|
|||
#ifdef FEAT_RIGHTLEFT
|
||||
EXTERN long p_aleph; // 'aleph'
|
||||
#endif
|
||||
EXTERN char_u *p_ambw; // 'ambiwidth'
|
||||
#ifdef FEAT_AUTOCHDIR
|
||||
EXTERN int p_acd; // 'autochdir'
|
||||
#endif
|
||||
EXTERN char_u *p_ambw; // 'ambiwidth'
|
||||
EXTERN char_u *p_emoji; // 'emoji'
|
||||
EXTERN int p_ai; // 'autoindent'
|
||||
EXTERN int p_bin; // 'binary'
|
||||
EXTERN int p_bomb; // 'bomb'
|
||||
EXTERN int p_bl; // 'buflisted'
|
||||
#ifdef FEAT_CINDENT
|
||||
EXTERN int p_cin; // 'cindent'
|
||||
EXTERN char_u *p_cink; // 'cinkeys'
|
||||
#endif
|
||||
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
|
||||
EXTERN char_u *p_cinw; // 'cinwords'
|
||||
#endif
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
EXTERN char_u *p_cfu; // 'completefunc'
|
||||
EXTERN char_u *p_ofu; // 'omnifunc'
|
||||
#endif
|
||||
EXTERN int p_ci; // 'copyindent'
|
||||
#if defined(FEAT_GUI) && defined(MACOS_X)
|
||||
EXTERN int *p_antialias; // 'antialias'
|
||||
#endif
|
||||
|
@ -327,9 +389,6 @@ EXTERN char_u *p_bg; // 'background'
|
|||
EXTERN int p_bk; // 'backup'
|
||||
EXTERN char_u *p_bkc; // 'backupcopy'
|
||||
EXTERN unsigned bkc_flags; // flags from 'backupcopy'
|
||||
#ifdef IN_OPTION_C
|
||||
static char *(p_bkc_values[]) = {"yes", "auto", "no", "breaksymlink", "breakhardlink", NULL};
|
||||
#endif
|
||||
# define BKC_YES 0x001
|
||||
# define BKC_AUTO 0x002
|
||||
# define BKC_NO 0x004
|
||||
|
@ -339,13 +398,6 @@ EXTERN char_u *p_bdir; // 'backupdir'
|
|||
EXTERN char_u *p_bex; // 'backupext'
|
||||
EXTERN char_u *p_bo; // 'belloff'
|
||||
EXTERN unsigned bo_flags;
|
||||
# ifdef IN_OPTION_C
|
||||
static char *(p_bo_values[]) = {"all", "backspace", "cursor", "complete",
|
||||
"copy", "ctrlg", "error", "esc", "ex",
|
||||
"hangul", "insertmode", "lang", "mess",
|
||||
"showmatch", "operator", "register", "shell",
|
||||
"spell", "wildmode", NULL};
|
||||
# endif
|
||||
|
||||
// values for the 'beepon' option
|
||||
#define BO_ALL 0x0001
|
||||
|
@ -392,11 +444,10 @@ EXTERN char_u *p_bsdir; // 'browsedir'
|
|||
#ifdef FEAT_LINEBREAK
|
||||
EXTERN char_u *p_breakat; // 'breakat'
|
||||
#endif
|
||||
EXTERN char_u *p_bh; // 'bufhidden'
|
||||
EXTERN char_u *p_bt; // 'buftype'
|
||||
EXTERN char_u *p_cmp; // 'casemap'
|
||||
EXTERN unsigned cmp_flags;
|
||||
#ifdef IN_OPTION_C
|
||||
static char *(p_cmp_values[]) = {"internal", "keepascii", NULL};
|
||||
#endif
|
||||
#define CMP_INTERNAL 0x001
|
||||
#define CMP_KEEPASCII 0x002
|
||||
EXTERN char_u *p_enc; // 'encoding'
|
||||
|
@ -404,6 +455,7 @@ EXTERN int p_deco; // 'delcombine'
|
|||
#ifdef FEAT_EVAL
|
||||
EXTERN char_u *p_ccv; // 'charconvert'
|
||||
#endif
|
||||
EXTERN char_u *p_cino; // 'cinoptions'
|
||||
#ifdef FEAT_CMDWIN
|
||||
EXTERN char_u *p_cedit; // 'cedit'
|
||||
EXTERN long p_cwh; // 'cmdwinheight'
|
||||
|
@ -412,6 +464,10 @@ EXTERN long p_cwh; // 'cmdwinheight'
|
|||
EXTERN char_u *p_cb; // 'clipboard'
|
||||
#endif
|
||||
EXTERN long p_ch; // 'cmdheight'
|
||||
#ifdef FEAT_FOLDING
|
||||
EXTERN char_u *p_cms; // 'commentstring'
|
||||
#endif
|
||||
EXTERN char_u *p_cpt; // 'complete'
|
||||
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
|
||||
EXTERN int p_confirm; // 'confirm'
|
||||
#endif
|
||||
|
@ -422,6 +478,9 @@ EXTERN char_u *p_csl; // 'completeslash'
|
|||
#endif
|
||||
EXTERN long p_ph; // 'pumheight'
|
||||
EXTERN long p_pw; // 'pumwidth'
|
||||
#ifdef FEAT_COMMENTS
|
||||
EXTERN char_u *p_com; // 'comments'
|
||||
#endif
|
||||
EXTERN char_u *p_cpo; // 'cpoptions'
|
||||
#ifdef FEAT_CSCOPE
|
||||
EXTERN char_u *p_csprg; // 'cscopeprg'
|
||||
|
@ -454,14 +513,12 @@ EXTERN int p_dg; // 'digraph'
|
|||
EXTERN char_u *p_dir; // 'directory'
|
||||
EXTERN char_u *p_dy; // 'display'
|
||||
EXTERN unsigned dy_flags;
|
||||
#ifdef IN_OPTION_C
|
||||
static char *(p_dy_values[]) = {"lastline", "truncate", "uhex", NULL};
|
||||
#endif
|
||||
#define DY_LASTLINE 0x001
|
||||
#define DY_TRUNCATE 0x002
|
||||
#define DY_UHEX 0x004
|
||||
EXTERN int p_ed; // 'edcompatible'
|
||||
EXTERN char_u *p_ead; // 'eadirection'
|
||||
EXTERN char_u *p_emoji; // 'emoji'
|
||||
EXTERN int p_ea; // 'equalalways'
|
||||
EXTERN char_u *p_ep; // 'equalprg'
|
||||
EXTERN int p_eb; // 'errorbells'
|
||||
|
@ -471,22 +528,24 @@ EXTERN char_u *p_efm; // 'errorformat'
|
|||
EXTERN char_u *p_gefm; // 'grepformat'
|
||||
EXTERN char_u *p_gp; // 'grepprg'
|
||||
#endif
|
||||
EXTERN char_u *p_ei; // 'eventignore'
|
||||
EXTERN int p_eol; // 'endofline'
|
||||
EXTERN int p_ek; // 'esckeys'
|
||||
EXTERN char_u *p_ei; // 'eventignore'
|
||||
EXTERN int p_et; // 'expandtab'
|
||||
EXTERN int p_exrc; // 'exrc'
|
||||
EXTERN char_u *p_fenc; // 'fileencoding'
|
||||
EXTERN char_u *p_fencs; // 'fileencodings'
|
||||
EXTERN char_u *p_ff; // 'fileformat'
|
||||
EXTERN char_u *p_ffs; // 'fileformats'
|
||||
EXTERN long p_fic; // 'fileignorecase'
|
||||
EXTERN char_u *p_ft; // 'filetype'
|
||||
EXTERN char_u *p_fcs; // 'fillchar'
|
||||
EXTERN int p_fixeol; // 'fixendofline'
|
||||
#ifdef FEAT_FOLDING
|
||||
EXTERN char_u *p_fcl; // 'foldclose'
|
||||
EXTERN long p_fdls; // 'foldlevelstart'
|
||||
EXTERN char_u *p_fdo; // 'foldopen'
|
||||
EXTERN unsigned fdo_flags;
|
||||
# ifdef IN_OPTION_C
|
||||
static char *(p_fdo_values[]) = {"all", "block", "hor", "mark", "percent",
|
||||
"quickfix", "search", "tag", "insert",
|
||||
"undo", "jump", NULL};
|
||||
# endif
|
||||
# define FDO_ALL 0x001
|
||||
# define FDO_BLOCK 0x002
|
||||
# define FDO_HOR 0x004
|
||||
|
@ -499,6 +558,11 @@ static char *(p_fdo_values[]) = {"all", "block", "hor", "mark", "percent",
|
|||
# define FDO_UNDO 0x200
|
||||
# define FDO_JUMP 0x400
|
||||
#endif
|
||||
#if defined(FEAT_EVAL)
|
||||
EXTERN char_u *p_fex; // 'formatexpr'
|
||||
#endif
|
||||
EXTERN char_u *p_flp; // 'formatlistpat'
|
||||
EXTERN char_u *p_fo; // 'formatoptions'
|
||||
EXTERN char_u *p_fp; // 'formatprg'
|
||||
#ifdef HAVE_FSYNC
|
||||
EXTERN int p_fs; // 'fsync'
|
||||
|
@ -580,12 +644,29 @@ EXTERN char_u *p_imsf; // 'imstatusfunc'
|
|||
#endif
|
||||
EXTERN int p_imcmdline; // 'imcmdline'
|
||||
EXTERN int p_imdisable; // 'imdisable'
|
||||
EXTERN long p_iminsert; // 'iminsert'
|
||||
EXTERN long p_imsearch; // 'imsearch'
|
||||
EXTERN int p_inf; // 'infercase'
|
||||
#if defined(FEAT_FIND_ID) && defined(FEAT_EVAL)
|
||||
EXTERN char_u *p_inex; // 'includeexpr'
|
||||
#endif
|
||||
EXTERN int p_is; // 'incsearch'
|
||||
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
|
||||
EXTERN char_u *p_inde; // 'indentexpr'
|
||||
EXTERN char_u *p_indk; // 'indentkeys'
|
||||
#endif
|
||||
EXTERN int p_im; // 'insertmode'
|
||||
EXTERN char_u *p_isf; // 'isfname'
|
||||
EXTERN char_u *p_isi; // 'isident'
|
||||
EXTERN char_u *p_isk; // 'iskeyword'
|
||||
EXTERN char_u *p_isp; // 'isprint'
|
||||
EXTERN int p_js; // 'joinspaces'
|
||||
#ifdef FEAT_CRYPT
|
||||
EXTERN char_u *p_key; // 'key'
|
||||
#endif
|
||||
#ifdef FEAT_KEYMAP
|
||||
EXTERN char_u *p_keymap; // 'keymap'
|
||||
#endif
|
||||
EXTERN char_u *p_kp; // 'keywordprg'
|
||||
EXTERN char_u *p_km; // 'keymodel'
|
||||
#ifdef FEAT_LANGMAP
|
||||
|
@ -600,6 +681,7 @@ EXTERN char_u *p_lm; // 'langmenu'
|
|||
EXTERN long p_linespace; // 'linespace'
|
||||
#endif
|
||||
#ifdef FEAT_LISP
|
||||
EXTERN int p_lisp; // 'lisp'
|
||||
EXTERN char_u *p_lispwords; // 'lispwords'
|
||||
#endif
|
||||
EXTERN long p_ls; // 'laststatus'
|
||||
|
@ -620,6 +702,7 @@ EXTERN char_u *p_menc; // 'makeencoding'
|
|||
EXTERN char_u *p_mef; // 'makeef'
|
||||
EXTERN char_u *p_mp; // 'makeprg'
|
||||
#endif
|
||||
EXTERN char_u *p_mps; // 'matchpairs'
|
||||
#ifdef FEAT_SIGNS
|
||||
EXTERN char_u *p_scl; // signcolumn
|
||||
#endif
|
||||
|
@ -642,8 +725,11 @@ EXTERN long p_mis; // 'menuitems'
|
|||
#ifdef FEAT_SPELL
|
||||
EXTERN char_u *p_msm; // 'mkspellmem'
|
||||
#endif
|
||||
EXTERN int p_ml; // 'modeline'
|
||||
EXTERN long p_mle; // 'modelineexpr'
|
||||
EXTERN long p_mls; // 'modelines'
|
||||
EXTERN int p_ma; // 'modifiable'
|
||||
EXTERN int p_mod; // 'modified'
|
||||
EXTERN char_u *p_mouse; // 'mouse'
|
||||
#ifdef FEAT_GUI
|
||||
EXTERN int p_mousef; // 'mousefocus'
|
||||
|
@ -659,6 +745,7 @@ EXTERN char_u *p_mzschemedll; // 'mzschemedll'
|
|||
EXTERN char_u *p_mzschemegcdll; // 'mzschemegcdll'
|
||||
# endif
|
||||
#endif
|
||||
EXTERN char_u *p_nf; // 'nrformats'
|
||||
#if defined(MSWIN)
|
||||
EXTERN int p_odev; // 'opendevice'
|
||||
#endif
|
||||
|
@ -677,6 +764,7 @@ EXTERN char_u *p_cdpath; // 'cdpath'
|
|||
#if defined(DYNAMIC_PERL)
|
||||
EXTERN char_u *p_perldll; // 'perldll'
|
||||
#endif
|
||||
EXTERN int p_pi; // 'preserveindent'
|
||||
#if defined(DYNAMIC_PYTHON3)
|
||||
EXTERN char_u *p_py3dll; // 'pythonthreedll'
|
||||
#endif
|
||||
|
@ -692,6 +780,10 @@ EXTERN char_u *p_pyhome; // 'pythonhome'
|
|||
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
|
||||
EXTERN long p_pyx; // 'pyxversion'
|
||||
#endif
|
||||
#ifdef FEAT_TEXTOBJ
|
||||
EXTERN char_u *p_qe; // 'quoteescape'
|
||||
#endif
|
||||
EXTERN int p_ro; // 'readonly'
|
||||
#ifdef FEAT_RELTIME
|
||||
EXTERN long p_rdt; // 'redrawtime'
|
||||
#endif
|
||||
|
@ -732,12 +824,6 @@ EXTERN char_u *p_slm; // 'selectmode'
|
|||
#ifdef FEAT_SESSION
|
||||
EXTERN char_u *p_ssop; // 'sessionoptions'
|
||||
EXTERN unsigned ssop_flags;
|
||||
# ifdef IN_OPTION_C
|
||||
// Also used for 'viewoptions'!
|
||||
static char *(p_ssop_values[]) = {"buffers", "winpos", "resize", "winsize",
|
||||
"localoptions", "options", "help", "blank", "globals", "slash", "unix",
|
||||
"sesdir", "curdir", "folds", "cursor", "tabpages", "terminal", NULL};
|
||||
# endif
|
||||
# define SSOP_BUFFERS 0x001
|
||||
# define SSOP_WINPOS 0x002
|
||||
# define SSOP_RESIZE 0x004
|
||||
|
@ -776,7 +862,9 @@ EXTERN int p_ssl; // 'shellslash'
|
|||
EXTERN char_u *p_stl; // 'statusline'
|
||||
#endif
|
||||
EXTERN int p_sr; // 'shiftround'
|
||||
EXTERN long p_sw; // 'shiftwidth'
|
||||
EXTERN char_u *p_shm; // 'shortmess'
|
||||
EXTERN int p_sn; // 'shortname'
|
||||
#ifdef FEAT_LINEBREAK
|
||||
EXTERN char_u *p_sbr; // 'showbreak'
|
||||
#endif
|
||||
|
@ -789,13 +877,30 @@ EXTERN int p_smd; // 'showmode'
|
|||
EXTERN long p_ss; // 'sidescroll'
|
||||
EXTERN long p_siso; // 'sidescrolloff'
|
||||
EXTERN int p_scs; // 'smartcase'
|
||||
#ifdef FEAT_SMARTINDENT
|
||||
EXTERN int p_si; // 'smartindent'
|
||||
#endif
|
||||
EXTERN int p_sta; // 'smarttab'
|
||||
EXTERN long p_sts; // 'softtabstop'
|
||||
EXTERN int p_sb; // 'splitbelow'
|
||||
#if defined(FEAT_SEARCHPATH)
|
||||
EXTERN char_u *p_sua; // 'suffixesadd'
|
||||
#endif
|
||||
EXTERN int p_swf; // 'swapfile'
|
||||
#ifdef FEAT_SYN_HL
|
||||
EXTERN long p_smc; // 'synmaxcol'
|
||||
#endif
|
||||
EXTERN long p_tpm; // 'tabpagemax'
|
||||
# if defined(FEAT_STL_OPT)
|
||||
#ifdef FEAT_STL_OPT
|
||||
EXTERN char_u *p_tal; // 'tabline'
|
||||
# endif
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
EXTERN char_u *p_tfu; // 'tagfunc'
|
||||
#endif
|
||||
#ifdef FEAT_SPELL
|
||||
EXTERN char_u *p_spc; // 'spellcapcheck'
|
||||
EXTERN char_u *p_spf; // 'spellfile'
|
||||
EXTERN char_u *p_spl; // 'spelllang'
|
||||
EXTERN char_u *p_sps; // 'spellsuggest'
|
||||
#endif
|
||||
EXTERN int p_spr; // 'splitright'
|
||||
|
@ -804,20 +909,16 @@ EXTERN char_u *p_su; // 'suffixes'
|
|||
EXTERN char_u *p_sws; // 'swapsync'
|
||||
EXTERN char_u *p_swb; // 'switchbuf'
|
||||
EXTERN unsigned swb_flags;
|
||||
#ifdef IN_OPTION_C
|
||||
static char *(p_swb_values[]) = {"useopen", "usetab", "split", "newtab", "vsplit", NULL};
|
||||
#endif
|
||||
#define SWB_USEOPEN 0x001
|
||||
#define SWB_USETAB 0x002
|
||||
#define SWB_SPLIT 0x004
|
||||
#define SWB_NEWTAB 0x008
|
||||
#define SWB_VSPLIT 0x010
|
||||
EXTERN char_u *p_syn; // 'syntax'
|
||||
EXTERN long p_ts; // 'tabstop'
|
||||
EXTERN int p_tbs; // 'tagbsearch'
|
||||
EXTERN char_u *p_tc; // 'tagcase'
|
||||
EXTERN unsigned tc_flags; // flags from 'tagcase'
|
||||
#ifdef IN_OPTION_C
|
||||
static char *(p_tc_values[]) = {"followic", "ignore", "match", "followscs", "smart", NULL};
|
||||
#endif
|
||||
#define TC_FOLLOWIC 0x01
|
||||
#define TC_IGNORE 0x02
|
||||
#define TC_MATCH 0x04
|
||||
|
@ -837,11 +938,16 @@ EXTERN char_u *p_tenc; // 'termencoding'
|
|||
#ifdef FEAT_TERMGUICOLORS
|
||||
EXTERN int p_tgc; // 'termguicolors'
|
||||
#endif
|
||||
#ifdef FEAT_TERMINAL
|
||||
EXTERN long p_twsl; // 'termwinscroll'
|
||||
#endif
|
||||
#if defined(MSWIN) && defined(FEAT_TERMINAL)
|
||||
EXTERN char_u *p_twt; // 'termwintype'
|
||||
#endif
|
||||
EXTERN int p_terse; // 'terse'
|
||||
EXTERN int p_ta; // 'textauto'
|
||||
EXTERN int p_tx; // 'textmode'
|
||||
EXTERN long p_tw; // 'textwidth'
|
||||
EXTERN int p_to; // 'tildeop'
|
||||
EXTERN int p_timeout; // 'timeout'
|
||||
EXTERN long p_tm; // 'timeoutlen'
|
||||
|
@ -859,9 +965,6 @@ EXTERN int p_tf; // 'ttyfast'
|
|||
#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN)
|
||||
EXTERN char_u *p_toolbar; // 'toolbar'
|
||||
EXTERN unsigned toolbar_flags;
|
||||
# ifdef IN_OPTION_C
|
||||
static char *(p_toolbar_values[]) = {"text", "icons", "tooltips", "horiz", NULL};
|
||||
# endif
|
||||
# define TOOLBAR_TEXT 0x01
|
||||
# define TOOLBAR_ICONS 0x02
|
||||
# define TOOLBAR_TOOLTIPS 0x04
|
||||
|
@ -870,9 +973,6 @@ static char *(p_toolbar_values[]) = {"text", "icons", "tooltips", "horiz", NULL}
|
|||
#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK)
|
||||
EXTERN char_u *p_tbis; // 'toolbariconsize'
|
||||
EXTERN unsigned tbis_flags;
|
||||
# ifdef IN_OPTION_C
|
||||
static char *(p_tbis_values[]) = {"tiny", "small", "medium", "large", "huge", "giant", NULL};
|
||||
# endif
|
||||
# define TBIS_TINY 0x01
|
||||
# define TBIS_SMALL 0x02
|
||||
# define TBIS_MEDIUM 0x04
|
||||
|
@ -884,9 +984,6 @@ EXTERN long p_ttyscroll; // 'ttyscroll'
|
|||
#if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
|
||||
EXTERN char_u *p_ttym; // 'ttymouse'
|
||||
EXTERN unsigned ttym_flags;
|
||||
# ifdef IN_OPTION_C
|
||||
static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", "urxvt", "sgr", NULL};
|
||||
# endif
|
||||
# define TTYM_XTERM 0x01
|
||||
# define TTYM_XTERM2 0x02
|
||||
# define TTYM_DEC 0x04
|
||||
|
@ -897,11 +994,17 @@ static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm"
|
|||
# define TTYM_SGR 0x80
|
||||
#endif
|
||||
EXTERN char_u *p_udir; // 'undodir'
|
||||
#ifdef FEAT_PERSISTENT_UNDO
|
||||
EXTERN int p_udf; // 'undofile'
|
||||
#endif
|
||||
EXTERN long p_ul; // 'undolevels'
|
||||
EXTERN long p_ur; // 'undoreload'
|
||||
EXTERN long p_uc; // 'updatecount'
|
||||
EXTERN long p_ut; // 'updatetime'
|
||||
EXTERN char_u *p_fcs; // 'fillchar'
|
||||
#ifdef FEAT_VARTABS
|
||||
EXTERN char_u *p_vsts; // 'varsofttabstop'
|
||||
EXTERN char_u *p_vts; // 'vartabstop'
|
||||
#endif
|
||||
#ifdef FEAT_VIMINFO
|
||||
EXTERN char_u *p_viminfo; // 'viminfo'
|
||||
EXTERN char_u *p_viminfofile; // 'viminfofile'
|
||||
|
@ -914,9 +1017,6 @@ EXTERN unsigned vop_flags; // uses SSOP_ flags
|
|||
EXTERN int p_vb; // 'visualbell'
|
||||
EXTERN char_u *p_ve; // 'virtualedit'
|
||||
EXTERN unsigned ve_flags;
|
||||
#ifdef IN_OPTION_C
|
||||
static char *(p_ve_values[]) = {"block", "insert", "all", "onemore", NULL};
|
||||
#endif
|
||||
#define VE_BLOCK 5 // includes "all"
|
||||
#define VE_INSERT 6 // includes "all"
|
||||
#define VE_ALL 4
|
||||
|
@ -954,6 +1054,7 @@ EXTERN long p_wiw; // 'winwidth'
|
|||
#if defined(MSWIN) && defined(FEAT_TERMINAL)
|
||||
EXTERN char_u *p_winptydll; // 'winptydll'
|
||||
#endif
|
||||
EXTERN long p_wm; // 'wrapmargin'
|
||||
EXTERN int p_ws; // 'wrapscan'
|
||||
EXTERN int p_write; // 'write'
|
||||
EXTERN int p_wa; // 'writeany'
|
||||
|
|
197
src/optiondefs.h
197
src/optiondefs.h
|
@ -243,112 +243,6 @@ typedef enum
|
|||
// buffers. Indicate this by setting "var" to VAR_WIN.
|
||||
#define VAR_WIN ((char_u *)-1)
|
||||
|
||||
// These are the global values for options which are also local to a buffer.
|
||||
// Only to be used in option.c!
|
||||
static int p_ai;
|
||||
static int p_bin;
|
||||
static int p_bomb;
|
||||
static char_u *p_bh;
|
||||
static char_u *p_bt;
|
||||
static int p_bl;
|
||||
static int p_ci;
|
||||
#ifdef FEAT_CINDENT
|
||||
static int p_cin;
|
||||
static char_u *p_cink;
|
||||
static char_u *p_cino;
|
||||
#endif
|
||||
#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
|
||||
static char_u *p_cinw;
|
||||
#endif
|
||||
#ifdef FEAT_COMMENTS
|
||||
static char_u *p_com;
|
||||
#endif
|
||||
#ifdef FEAT_FOLDING
|
||||
static char_u *p_cms;
|
||||
#endif
|
||||
static char_u *p_cpt;
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
static char_u *p_cfu;
|
||||
static char_u *p_ofu;
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
static char_u *p_tfu;
|
||||
#endif
|
||||
static int p_eol;
|
||||
static int p_fixeol;
|
||||
static int p_et;
|
||||
static char_u *p_fenc;
|
||||
static char_u *p_ff;
|
||||
static char_u *p_fo;
|
||||
static char_u *p_flp;
|
||||
static char_u *p_ft;
|
||||
static long p_iminsert;
|
||||
static long p_imsearch;
|
||||
#if defined(FEAT_FIND_ID) && defined(FEAT_EVAL)
|
||||
static char_u *p_inex;
|
||||
#endif
|
||||
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
|
||||
static char_u *p_inde;
|
||||
static char_u *p_indk;
|
||||
#endif
|
||||
#if defined(FEAT_EVAL)
|
||||
static char_u *p_fex;
|
||||
#endif
|
||||
static int p_inf;
|
||||
static char_u *p_isk;
|
||||
#ifdef FEAT_CRYPT
|
||||
static char_u *p_key;
|
||||
#endif
|
||||
#ifdef FEAT_LISP
|
||||
static int p_lisp;
|
||||
#endif
|
||||
static int p_ml;
|
||||
static int p_ma;
|
||||
static int p_mod;
|
||||
static char_u *p_mps;
|
||||
static char_u *p_nf;
|
||||
static int p_pi;
|
||||
#ifdef FEAT_TEXTOBJ
|
||||
static char_u *p_qe;
|
||||
#endif
|
||||
static int p_ro;
|
||||
#ifdef FEAT_SMARTINDENT
|
||||
static int p_si;
|
||||
#endif
|
||||
static int p_sn;
|
||||
static long p_sts;
|
||||
#if defined(FEAT_SEARCHPATH)
|
||||
static char_u *p_sua;
|
||||
#endif
|
||||
static long p_sw;
|
||||
static int p_swf;
|
||||
#ifdef FEAT_SYN_HL
|
||||
static long p_smc;
|
||||
static char_u *p_syn;
|
||||
#endif
|
||||
#ifdef FEAT_SPELL
|
||||
static char_u *p_spc;
|
||||
static char_u *p_spf;
|
||||
static char_u *p_spl;
|
||||
#endif
|
||||
static long p_ts;
|
||||
static long p_tw;
|
||||
static int p_tx;
|
||||
#ifdef FEAT_PERSISTENT_UNDO
|
||||
static int p_udf;
|
||||
#endif
|
||||
static long p_wm;
|
||||
#ifdef FEAT_VARTABS
|
||||
static char_u *p_vsts;
|
||||
static char_u *p_vts;
|
||||
#endif
|
||||
#ifdef FEAT_KEYMAP
|
||||
static char_u *p_keymap;
|
||||
#endif
|
||||
#ifdef FEAT_TERMINAL
|
||||
static long p_twsl; // 'termwinscroll'
|
||||
#endif
|
||||
|
||||
// Saved values for when 'bin' is set.
|
||||
static int p_et_nobin;
|
||||
static int p_ml_nobin;
|
||||
|
@ -387,53 +281,6 @@ struct vimoption
|
|||
#define VI_DEFAULT 0 // def_val[VI_DEFAULT] is Vi default value
|
||||
#define VIM_DEFAULT 1 // def_val[VIM_DEFAULT] is Vim default value
|
||||
|
||||
//
|
||||
// Flags
|
||||
//
|
||||
#define P_BOOL 0x01 // the option is boolean
|
||||
#define P_NUM 0x02 // the option is numeric
|
||||
#define P_STRING 0x04 // the option is a string
|
||||
#define P_ALLOCED 0x08 // the string option is in allocated memory,
|
||||
// must use free_string_option() when
|
||||
// assigning new value. Not set if default is
|
||||
// the same.
|
||||
#define P_EXPAND 0x10 // environment expansion. NOTE: P_EXPAND can
|
||||
// never be used for local or hidden options!
|
||||
#define P_NODEFAULT 0x40 // don't set to default value
|
||||
#define P_DEF_ALLOCED 0x80 // default value is in allocated memory, must
|
||||
// use vim_free() when assigning new value
|
||||
#define P_WAS_SET 0x100 // option has been set/reset
|
||||
#define P_NO_MKRC 0x200 // don't include in :mkvimrc output
|
||||
#define P_VI_DEF 0x400 // Use Vi default for Vim
|
||||
#define P_VIM 0x800 // Vim option, reset when 'cp' set
|
||||
|
||||
// when option changed, what to display:
|
||||
#define P_RSTAT 0x1000 // redraw status lines
|
||||
#define P_RWIN 0x2000 // redraw current window and recompute text
|
||||
#define P_RBUF 0x4000 // redraw current buffer and recompute text
|
||||
#define P_RALL 0x6000 // redraw all windows
|
||||
#define P_RCLR 0x7000 // clear and redraw all
|
||||
|
||||
#define P_COMMA 0x8000 // comma separated list
|
||||
#define P_ONECOMMA 0x18000L // P_COMMA and cannot have two consecutive
|
||||
// commas
|
||||
#define P_NODUP 0x20000L // don't allow duplicate strings
|
||||
#define P_FLAGLIST 0x40000L // list of single-char flags
|
||||
|
||||
#define P_SECURE 0x80000L // cannot change in modeline or secure mode
|
||||
#define P_GETTEXT 0x100000L // expand default value with _()
|
||||
#define P_NOGLOB 0x200000L // do not use local value for global vimrc
|
||||
#define P_NFNAME 0x400000L // only normal file name chars allowed
|
||||
#define P_INSECURE 0x800000L // option was set from a modeline
|
||||
#define P_PRI_MKRC 0x1000000L // priority for :mkvimrc (setting option has
|
||||
// side effects)
|
||||
#define P_NO_ML 0x2000000L // not allowed in modeline
|
||||
#define P_CURSWANT 0x4000000L // update curswant required; not needed when
|
||||
// there is a redraw flag
|
||||
#define P_NDNAME 0x8000000L // only normal dir name chars allowed
|
||||
#define P_RWINONLY 0x10000000L // only redraw current window
|
||||
#define P_MLE 0x20000000L // under control of 'modelineexpr'
|
||||
|
||||
#define ISK_LATIN1 (char_u *)"@,48-57,_,192-255"
|
||||
|
||||
// 'isprint' for latin1 is also used for MS-Windows cp1252, where 0x80 is used
|
||||
|
@ -3158,45 +3005,5 @@ static struct vimoption options[] =
|
|||
|
||||
#define PARAM_COUNT (sizeof(options) / sizeof(struct vimoption))
|
||||
|
||||
static char *(p_ambw_values[]) = {"single", "double", NULL};
|
||||
static char *(p_bg_values[]) = {"light", "dark", NULL};
|
||||
static char *(p_nf_values[]) = {"bin", "octal", "hex", "alpha", NULL};
|
||||
static char *(p_ff_values[]) = {FF_UNIX, FF_DOS, FF_MAC, NULL};
|
||||
#ifdef FEAT_CRYPT
|
||||
static char *(p_cm_values[]) = {"zip", "blowfish", "blowfish2", NULL};
|
||||
#endif
|
||||
static char *(p_wop_values[]) = {"tagfile", NULL};
|
||||
#ifdef FEAT_WAK
|
||||
static char *(p_wak_values[]) = {"yes", "menu", "no", NULL};
|
||||
#endif
|
||||
static char *(p_mousem_values[]) = {"extend", "popup", "popup_setpos", "mac", NULL};
|
||||
static char *(p_sel_values[]) = {"inclusive", "exclusive", "old", NULL};
|
||||
static char *(p_slm_values[]) = {"mouse", "key", "cmd", NULL};
|
||||
static char *(p_km_values[]) = {"startsel", "stopsel", NULL};
|
||||
#ifdef FEAT_BROWSE
|
||||
static char *(p_bsdir_values[]) = {"current", "last", "buffer", NULL};
|
||||
#endif
|
||||
static char *(p_scbopt_values[]) = {"ver", "hor", "jump", NULL};
|
||||
static char *(p_debug_values[]) = {"msg", "throw", "beep", NULL};
|
||||
static char *(p_ead_values[]) = {"both", "ver", "hor", NULL};
|
||||
static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "terminal", "acwrite", "prompt", "popup", NULL};
|
||||
static char *(p_bufhidden_values[]) = {"hide", "unload", "delete", "wipe", NULL};
|
||||
static char *(p_bs_values[]) = {"indent", "eol", "start", NULL};
|
||||
#ifdef FEAT_FOLDING
|
||||
static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax",
|
||||
# ifdef FEAT_DIFF
|
||||
"diff",
|
||||
# endif
|
||||
NULL};
|
||||
static char *(p_fcl_values[]) = {"all", NULL};
|
||||
#endif
|
||||
static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "noinsert", "noselect", NULL};
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
static char *(p_csl_values[]) = {"slash", "backslash", NULL};
|
||||
#endif
|
||||
#ifdef FEAT_SIGNS
|
||||
static char *(p_scl_values[]) = {"yes", "no", "auto", "number", NULL};
|
||||
#endif
|
||||
#if defined(MSWIN) && defined(FEAT_TERMINAL)
|
||||
static char *(p_twt_values[]) = {"winpty", "conpty", "", NULL};
|
||||
#endif
|
||||
// The following is needed to make the gen_opt_test.vim script work.
|
||||
// {"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -135,7 +135,7 @@ static int get_x11_title(int);
|
|||
|
||||
static char_u *oldtitle = NULL;
|
||||
static volatile sig_atomic_t oldtitle_outdated = FALSE;
|
||||
static int did_set_title = FALSE;
|
||||
static int unix_did_set_title = FALSE;
|
||||
static char_u *oldicon = NULL;
|
||||
static int did_set_icon = FALSE;
|
||||
#endif
|
||||
|
@ -2187,7 +2187,7 @@ mch_settitle(char_u *title, char_u *icon)
|
|||
else
|
||||
gui_mch_settitle(title, icon);
|
||||
#endif
|
||||
did_set_title = TRUE;
|
||||
unix_did_set_title = TRUE;
|
||||
}
|
||||
|
||||
if ((type || *T_CIS != NUL) && icon != NULL)
|
||||
|
@ -2228,10 +2228,10 @@ mch_settitle(char_u *title, char_u *icon)
|
|||
void
|
||||
mch_restore_title(int which)
|
||||
{
|
||||
int do_push_pop = did_set_title || did_set_icon;
|
||||
int do_push_pop = unix_did_set_title || did_set_icon;
|
||||
|
||||
/* only restore the title or icon when it has been set */
|
||||
mch_settitle(((which & SAVE_RESTORE_TITLE) && did_set_title) ?
|
||||
mch_settitle(((which & SAVE_RESTORE_TITLE) && unix_did_set_title) ?
|
||||
(oldtitle ? oldtitle : p_titleold) : NULL,
|
||||
((which & SAVE_RESTORE_ICON) && did_set_icon) ? oldicon : NULL);
|
||||
|
||||
|
|
|
@ -178,6 +178,7 @@ void qsort(void *base, size_t elm_count, size_t elm_size, int (*cmp)(const void
|
|||
# include "normal.pro"
|
||||
# include "ops.pro"
|
||||
# include "option.pro"
|
||||
# include "optionstr.pro"
|
||||
# include "popupmnu.pro"
|
||||
# if defined(FEAT_PROFILE) || defined(FEAT_RELTIME)
|
||||
# include "profiler.pro"
|
||||
|
|
|
@ -10,22 +10,32 @@ void set_helplang_default(char_u *lang);
|
|||
void init_gui_options(void);
|
||||
void set_title_defaults(void);
|
||||
int do_set(char_u *arg, int opt_flags);
|
||||
void did_set_option(int opt_idx, int opt_flags, int new_value, int value_checked);
|
||||
int string_to_key(char_u *arg, int multi_byte);
|
||||
char *check_cedit(void);
|
||||
void did_set_title(void);
|
||||
void set_options_bin(int oldval, int newval, int opt_flags);
|
||||
void check_options(void);
|
||||
void check_buf_options(buf_T *buf);
|
||||
void free_string_option(char_u *p);
|
||||
void clear_string_option(char_u **pp);
|
||||
int get_term_opt_idx(char_u **p);
|
||||
int set_term_option_alloced(char_u **p);
|
||||
int was_set_insecurely(char_u *opt, int opt_flags);
|
||||
void set_string_option_direct(char_u *name, int opt_idx, char_u *val, int opt_flags, int set_sid);
|
||||
void set_string_option_direct_in_win(win_T *wp, char_u *name, int opt_idx, char_u *val, int opt_flags, int set_sid);
|
||||
void set_string_option_direct_in_buf(buf_T *buf, char_u *name, int opt_idx, char_u *val, int opt_flags, int set_sid);
|
||||
void redraw_titles(void);
|
||||
int valid_name(char_u *val, char *allowed);
|
||||
char *check_clipboard_option(void);
|
||||
void set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx);
|
||||
void set_term_option_sctx_idx(char *name, int opt_idx);
|
||||
void check_redraw(long_u flags);
|
||||
int findoption(char_u *arg);
|
||||
int get_option_value(char_u *name, long *numval, char_u **stringval, int opt_flags);
|
||||
int get_option_value_strict(char_u *name, long *numval, char_u **stringval, int opt_type, void *from);
|
||||
long_u get_option_flags(int opt_idx);
|
||||
void set_option_flag(int opt_idx, long_u flag);
|
||||
void clear_option_flag(int opt_idx, long_u flag);
|
||||
int is_global_option(int opt_idx);
|
||||
int is_global_local_option(int opt_idx);
|
||||
int is_window_local_option(int opt_idx);
|
||||
int is_hidden_option(int opt_idx);
|
||||
int is_crypt_key_option(int opt_idx);
|
||||
char_u *option_iter_next(void **option, int opt_type);
|
||||
char *set_option_value(char_u *name, long number, char_u *string, int opt_flags);
|
||||
char_u *get_term_code(char_u *tname);
|
||||
|
@ -37,7 +47,11 @@ void clear_termoptions(void);
|
|||
void free_termoptions(void);
|
||||
void free_one_termoption(char_u *var);
|
||||
void set_term_defaults(void);
|
||||
int istermoption_idx(int opt_idx);
|
||||
void unset_global_local_option(char_u *name, void *from);
|
||||
char_u *get_option_varp_scope(int opt_idx, int opt_flags);
|
||||
char_u *get_option_var(int opt_idx);
|
||||
char_u *get_option_fullname(int opt_idx);
|
||||
char_u *get_equalprg(void);
|
||||
void win_copy_options(win_T *wp_from, win_T *wp_to);
|
||||
void copy_winopt(winopt_T *from, winopt_T *to);
|
||||
|
@ -55,10 +69,11 @@ void vimrc_found(char_u *fname, char_u *envname);
|
|||
void change_compatible(int on);
|
||||
int option_was_set(char_u *name);
|
||||
int reset_option_was_set(char_u *name);
|
||||
void fill_breakat_flags(void);
|
||||
int check_opt_wim(void);
|
||||
int can_bs(int what);
|
||||
void save_file_ff(buf_T *buf);
|
||||
int file_ff_differs(buf_T *buf, int ignore_empty);
|
||||
int check_ff_value(char_u *p);
|
||||
int tabstop_set(char_u *var, int **array);
|
||||
int tabstop_padding(colnr_T col, int ts_arg, int *vts);
|
||||
int tabstop_at(colnr_T col, int ts, int *vts);
|
||||
|
@ -75,7 +90,9 @@ long get_sts_value(void);
|
|||
long get_scrolloff_value(void);
|
||||
long get_sidescrolloff_value(void);
|
||||
void find_mps_values(int *initc, int *findc, int *backwards, int switchit);
|
||||
int briopt_check(win_T *wp);
|
||||
unsigned int get_bkc_value(buf_T *buf);
|
||||
int signcolumn_on(win_T *wp);
|
||||
dict_T *get_winbuf_options(int bufopt);
|
||||
int fill_culopt_flags(char_u *val, win_T *wp);
|
||||
/* vim: set ft=c : */
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
/* optionstr.c */
|
||||
void didset_string_options(void);
|
||||
void trigger_optionsset_string(int opt_idx, int opt_flags, char_u *oldval, char_u *oldval_l, char_u *oldval_g, char_u *newval);
|
||||
char *did_set_string_option(int opt_idx, char_u **varp, int new_value_alloced, char_u *oldval, char *errbuf, int opt_flags, int *value_checked);
|
||||
void check_buf_options(buf_T *buf);
|
||||
void free_string_option(char_u *p);
|
||||
void clear_string_option(char_u **pp);
|
||||
void check_string_option(char_u **pp);
|
||||
void set_string_option_direct(char_u *name, int opt_idx, char_u *val, int opt_flags, int set_sid);
|
||||
void set_string_option_direct_in_win(win_T *wp, char_u *name, int opt_idx, char_u *val, int opt_flags, int set_sid);
|
||||
void set_string_option_direct_in_buf(buf_T *buf, char_u *name, int opt_idx, char_u *val, int opt_flags, int set_sid);
|
||||
char *set_string_option(int opt_idx, char_u *value, int opt_flags);
|
||||
int check_ff_value(char_u *p);
|
||||
/* vim: set ft=c : */
|
|
@ -757,6 +757,8 @@ static char *(features[]) =
|
|||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2045,
|
||||
/**/
|
||||
2044,
|
||||
/**/
|
||||
|
|
Loading…
Reference in New Issue