mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -07:00
lint
This commit is contained in:
parent
9b545dd3db
commit
654e92186b
@ -616,7 +616,8 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err)
|
||||
case kObjectTypeWindow:
|
||||
case kObjectTypeTabpage:
|
||||
case kObjectTypeInteger:
|
||||
if (obj.data.integer > VARNUMBER_MAX || obj.data.integer < VARNUMBER_MIN) {
|
||||
if (obj.data.integer > VARNUMBER_MAX
|
||||
|| obj.data.integer < VARNUMBER_MIN) {
|
||||
api_set_error(err, Validation, _("Integer value outside range"));
|
||||
return false;
|
||||
}
|
||||
|
@ -488,9 +488,9 @@ struct file_buffer {
|
||||
bool file_id_valid;
|
||||
FileID file_id;
|
||||
|
||||
int b_changed; /* 'modified': Set to true if something in the
|
||||
file has been changed and not written out. */
|
||||
int b_changedtick; /* incremented for each change, also for undo */
|
||||
int b_changed; // 'modified': Set to true if something in the
|
||||
// file has been changed and not written out.
|
||||
int b_changedtick; // incremented for each change, also for undo
|
||||
|
||||
bool b_saving; /* Set to true if we are in the middle of
|
||||
saving the buffer. */
|
||||
|
@ -21,7 +21,8 @@ static msgpack_zone zone;
|
||||
static msgpack_sbuffer sbuffer;
|
||||
|
||||
#define HANDLE_TYPE_CONVERSION_IMPL(t, lt) \
|
||||
bool msgpack_rpc_to_##lt(const msgpack_object *const obj, Integer *const arg) \
|
||||
bool msgpack_rpc_to_##lt(const msgpack_object *const obj, \
|
||||
Integer *const arg) \
|
||||
FUNC_ATTR_NONNULL_ALL \
|
||||
{ \
|
||||
if (obj->type != MSGPACK_OBJECT_EXT \
|
||||
|
@ -3706,23 +3706,19 @@ set_bool_option (
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* When 'lisp' option changes include/exclude '-' in
|
||||
* keyword characters.
|
||||
*/
|
||||
else if (varp == (char_u *)&(curbuf->b_p_lisp)) {
|
||||
(void)buf_init_chartab(curbuf, FALSE); /* ignore errors */
|
||||
}
|
||||
/* when 'title' changed, may need to change the title; same for 'icon' */
|
||||
else if ((int *)varp == &p_title) {
|
||||
did_set_title(FALSE);
|
||||
} else if (varp == (char_u *)&(curbuf->b_p_lisp)) {
|
||||
// When 'lisp' option changes include/exclude '-' in
|
||||
// keyword characters.
|
||||
(void)buf_init_chartab(curbuf, false); // ignore errors
|
||||
} else if ((int *)varp == &p_title) {
|
||||
// when 'title' changed, may need to change the title; same for 'icon'
|
||||
did_set_title(false);
|
||||
} else if ((int *)varp == &p_icon) {
|
||||
did_set_title(TRUE);
|
||||
did_set_title(true);
|
||||
} else if ((int *)varp == &curbuf->b_changed) {
|
||||
if (!value)
|
||||
save_file_ff(curbuf); /* Buffer is unchanged */
|
||||
if (!value) {
|
||||
save_file_ff(curbuf); // Buffer is unchanged
|
||||
}
|
||||
redraw_titles();
|
||||
modified_was_set = value;
|
||||
}
|
||||
@ -3751,10 +3747,11 @@ set_bool_option (
|
||||
if (curwin->w_p_wrap)
|
||||
curwin->w_leftcol = 0;
|
||||
} else if ((int *)varp == &p_ea) {
|
||||
if (p_ea && !old_value)
|
||||
if (p_ea && !old_value) {
|
||||
win_equal(curwin, false, 0);
|
||||
}
|
||||
} else if ((int *)varp == &p_acd) {
|
||||
/* Change directories when the 'acd' option is set now. */
|
||||
// Change directories when the 'acd' option is set now.
|
||||
do_autochdir();
|
||||
}
|
||||
/* 'diff' */
|
||||
@ -4513,10 +4510,11 @@ get_option_value (
|
||||
else {
|
||||
/* Special case: 'modified' is b_changed, but we also want to consider
|
||||
* it set when 'ff' or 'fenc' changed. */
|
||||
if ((int *)varp == &curbuf->b_changed)
|
||||
if ((int *)varp == &curbuf->b_changed) {
|
||||
*numval = curbufIsChanged();
|
||||
else
|
||||
} else {
|
||||
*numval = *(int *)varp;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -4884,14 +4882,15 @@ showoneopt (
|
||||
|
||||
varp = get_varp_scope(p, opt_flags);
|
||||
|
||||
/* for 'modified' we also need to check if 'ff' or 'fenc' changed. */
|
||||
// for 'modified' we also need to check if 'ff' or 'fenc' changed.
|
||||
if ((p->flags & P_BOOL) && ((int *)varp == &curbuf->b_changed
|
||||
? !curbufIsChanged() : !*(int *)varp))
|
||||
? !curbufIsChanged() : !*(int *)varp)) {
|
||||
MSG_PUTS("no");
|
||||
else if ((p->flags & P_BOOL) && *(int *)varp < 0)
|
||||
} else if ((p->flags & P_BOOL) && *(int *)varp < 0) {
|
||||
MSG_PUTS("--");
|
||||
else
|
||||
} else {
|
||||
MSG_PUTS(" ");
|
||||
}
|
||||
MSG_PUTS(p->fullname);
|
||||
if (!(p->flags & P_BOOL)) {
|
||||
msg_putchar('=');
|
||||
|
@ -294,16 +294,16 @@ enum {
|
||||
* The following are actual variables for the options
|
||||
*/
|
||||
|
||||
EXTERN long p_aleph; /* 'aleph' */
|
||||
EXTERN int p_acd; /* 'autochdir' */
|
||||
EXTERN char_u *p_ambw; /* 'ambiwidth' */
|
||||
EXTERN int p_ar; /* 'autoread' */
|
||||
EXTERN int p_aw; /* 'autowrite' */
|
||||
EXTERN int p_awa; /* 'autowriteall' */
|
||||
EXTERN char_u *p_bs; /* 'backspace' */
|
||||
EXTERN char_u *p_bg; /* 'background' */
|
||||
EXTERN int p_bk; /* 'backup' */
|
||||
EXTERN char_u *p_bkc; /* 'backupcopy' */
|
||||
EXTERN long p_aleph; // 'aleph'
|
||||
EXTERN int p_acd; // 'autochdir'
|
||||
EXTERN char_u *p_ambw; // 'ambiwidth'
|
||||
EXTERN int p_ar; // 'autoread'
|
||||
EXTERN int p_aw; // 'autowrite'
|
||||
EXTERN int p_awa; // 'autowriteall'
|
||||
EXTERN char_u *p_bs; // 'backspace'
|
||||
EXTERN char_u *p_bg; // 'background'
|
||||
EXTERN int p_bk; // 'backup'
|
||||
EXTERN char_u *p_bkc; // 'backupcopy'
|
||||
EXTERN unsigned int bkc_flags; ///< flags from 'backupcopy'
|
||||
#ifdef IN_OPTION_C
|
||||
static char *(p_bkc_values[]) =
|
||||
@ -649,26 +649,26 @@ char_u *p_vfile = (char_u *)""; /* used before options are initialized */
|
||||
#else
|
||||
extern char_u *p_vfile; /* 'verbosefile' */
|
||||
#endif
|
||||
EXTERN int p_warn; /* 'warn' */
|
||||
EXTERN char_u *p_wop; /* 'wildoptions' */
|
||||
EXTERN long p_window; /* 'window' */
|
||||
EXTERN char_u *p_wak; /* 'winaltkeys' */
|
||||
EXTERN char_u *p_wig; /* 'wildignore' */
|
||||
EXTERN char_u *p_ww; /* 'whichwrap' */
|
||||
EXTERN long p_wc; /* 'wildchar' */
|
||||
EXTERN long p_wcm; /* 'wildcharm' */
|
||||
EXTERN int p_wic; ///< 'wildignorecase'
|
||||
EXTERN char_u *p_wim; /* 'wildmode' */
|
||||
EXTERN int p_wmnu; /* 'wildmenu' */
|
||||
EXTERN long p_wh; /* 'winheight' */
|
||||
EXTERN long p_wmh; /* 'winminheight' */
|
||||
EXTERN long p_wmw; /* 'winminwidth' */
|
||||
EXTERN long p_wiw; /* 'winwidth' */
|
||||
EXTERN int p_ws; /* 'wrapscan' */
|
||||
EXTERN int p_write; /* 'write' */
|
||||
EXTERN int p_wa; /* 'writeany' */
|
||||
EXTERN int p_wb; /* 'writebackup' */
|
||||
EXTERN long p_wd; /* 'writedelay' */
|
||||
EXTERN int p_warn; // 'warn'
|
||||
EXTERN char_u *p_wop; // 'wildoptions'
|
||||
EXTERN long p_window; // 'window'
|
||||
EXTERN char_u *p_wak; // 'winaltkeys'
|
||||
EXTERN char_u *p_wig; // 'wildignore'
|
||||
EXTERN char_u *p_ww; // 'whichwrap'
|
||||
EXTERN long p_wc; // 'wildchar'
|
||||
EXTERN long p_wcm; // 'wildcharm'
|
||||
EXTERN int p_wic; // 'wildignorecase'
|
||||
EXTERN char_u *p_wim; // 'wildmode'
|
||||
EXTERN int p_wmnu; // 'wildmenu'
|
||||
EXTERN long p_wh; // 'winheight'
|
||||
EXTERN long p_wmh; // 'winminheight'
|
||||
EXTERN long p_wmw; // 'winminwidth'
|
||||
EXTERN long p_wiw; // 'winwidth'
|
||||
EXTERN int p_ws; // 'wrapscan'
|
||||
EXTERN int p_write; // 'write'
|
||||
EXTERN int p_wa; // 'writeany'
|
||||
EXTERN int p_wb; // 'writebackup'
|
||||
EXTERN long p_wd; // 'writedelay'
|
||||
|
||||
EXTERN int p_force_on; ///< options that cannot be turned off.
|
||||
EXTERN int p_force_off; ///< options that cannot be turned on.
|
||||
|
Loading…
Reference in New Issue
Block a user