mirror of
https://github.com/neovim/neovim.git
synced 2025-11-23 18:46:38 +00:00
*: Fix linter errors
Big function in expressions.c may be refactored, if I ever catch the idea how to split it right.
This commit is contained in:
@@ -6080,7 +6080,7 @@ char_u *add_char2buf(int c, char_u *s)
|
|||||||
{
|
{
|
||||||
char_u temp[MB_MAXBYTES + 1];
|
char_u temp[MB_MAXBYTES + 1];
|
||||||
const int len = utf_char2bytes(c, temp);
|
const int len = utf_char2bytes(c, temp);
|
||||||
for (int i = 0; i < len; ++i) {
|
for (int i = 0; i < len; i++) {
|
||||||
c = temp[i];
|
c = temp[i];
|
||||||
// Need to escape K_SPECIAL and CSI like in the typeahead buffer.
|
// Need to escape K_SPECIAL and CSI like in the typeahead buffer.
|
||||||
if (c == K_SPECIAL) {
|
if (c == K_SPECIAL) {
|
||||||
|
|||||||
@@ -25,21 +25,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static const struct modmasktable {
|
static const struct modmasktable {
|
||||||
short mod_mask; ///< Bit-mask for particular key modifier.
|
uint16_t mod_mask; ///< Bit-mask for particular key modifier.
|
||||||
short mod_flag; ///< Bit(s) for particular key modifier.
|
uint16_t mod_flag; ///< Bit(s) for particular key modifier.
|
||||||
char_u name; ///< Single letter name of modifier.
|
char_u name; ///< Single letter name of modifier.
|
||||||
} mod_mask_table[] = {
|
} mod_mask_table[] = {
|
||||||
{MOD_MASK_ALT, MOD_MASK_ALT, (char_u)'M'},
|
{ MOD_MASK_ALT, MOD_MASK_ALT, (char_u)'M' },
|
||||||
{MOD_MASK_META, MOD_MASK_META, (char_u)'T'},
|
{ MOD_MASK_META, MOD_MASK_META, (char_u)'T' },
|
||||||
{MOD_MASK_CTRL, MOD_MASK_CTRL, (char_u)'C'},
|
{ MOD_MASK_CTRL, MOD_MASK_CTRL, (char_u)'C' },
|
||||||
{MOD_MASK_SHIFT, MOD_MASK_SHIFT, (char_u)'S'},
|
{ MOD_MASK_SHIFT, MOD_MASK_SHIFT, (char_u)'S' },
|
||||||
{MOD_MASK_MULTI_CLICK, MOD_MASK_2CLICK, (char_u)'2'},
|
{ MOD_MASK_MULTI_CLICK, MOD_MASK_2CLICK, (char_u)'2' },
|
||||||
{MOD_MASK_MULTI_CLICK, MOD_MASK_3CLICK, (char_u)'3'},
|
{ MOD_MASK_MULTI_CLICK, MOD_MASK_3CLICK, (char_u)'3' },
|
||||||
{MOD_MASK_MULTI_CLICK, MOD_MASK_4CLICK, (char_u)'4'},
|
{ MOD_MASK_MULTI_CLICK, MOD_MASK_4CLICK, (char_u)'4' },
|
||||||
{MOD_MASK_CMD, MOD_MASK_CMD, (char_u)'D'},
|
{ MOD_MASK_CMD, MOD_MASK_CMD, (char_u)'D' },
|
||||||
// 'A' must be the last one
|
// 'A' must be the last one
|
||||||
{MOD_MASK_ALT, MOD_MASK_ALT, (char_u)'A'},
|
{ MOD_MASK_ALT, MOD_MASK_ALT, (char_u)'A' },
|
||||||
{0, 0, NUL}
|
{ 0, 0, NUL }
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -98,15 +98,23 @@ const uint8_t utf8len_tab[] = {
|
|||||||
|
|
||||||
// Like utf8len_tab above, but using a zero for illegal lead bytes.
|
// Like utf8len_tab above, but using a zero for illegal lead bytes.
|
||||||
const uint8_t utf8len_tab_zero[] = {
|
const uint8_t utf8len_tab_zero[] = {
|
||||||
//1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F
|
// ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 ?A ?B ?C ?D ?E ?F
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0?
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 2
|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, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B?
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C?
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // D?
|
||||||
|
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // E?
|
||||||
|
4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0, 0, // F?
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -5930,7 +5930,8 @@ static void syntime_report(void)
|
|||||||
// When making changes here, also change runtime/colors/default.vim!
|
// When making changes here, also change runtime/colors/default.vim!
|
||||||
|
|
||||||
static const char *highlight_init_both[] = {
|
static const char *highlight_init_both[] = {
|
||||||
"Conceal ctermbg=DarkGrey ctermfg=LightGrey guibg=DarkGrey guifg=LightGrey",
|
"Conceal "
|
||||||
|
"ctermbg=DarkGrey ctermfg=LightGrey guibg=DarkGrey guifg=LightGrey",
|
||||||
"Cursor guibg=fg guifg=bg",
|
"Cursor guibg=fg guifg=bg",
|
||||||
"lCursor guibg=fg guifg=bg",
|
"lCursor guibg=fg guifg=bg",
|
||||||
"DiffText cterm=bold ctermbg=Red gui=bold guibg=Red",
|
"DiffText cterm=bold ctermbg=Red gui=bold guibg=Red",
|
||||||
@@ -6211,11 +6212,9 @@ void syn_init_cmdline_highlight(bool reset, bool init)
|
|||||||
///
|
///
|
||||||
/// @param both include groups where 'bg' doesn't matter
|
/// @param both include groups where 'bg' doesn't matter
|
||||||
/// @param reset clear groups first
|
/// @param reset clear groups first
|
||||||
void
|
void init_highlight(bool both, bool reset)
|
||||||
init_highlight(int both, int reset)
|
|
||||||
{
|
{
|
||||||
int i;
|
static int had_both = false;
|
||||||
static int had_both = FALSE;
|
|
||||||
|
|
||||||
// Try finding the color scheme file. Used when a color file was loaded
|
// Try finding the color scheme file. Used when a color file was loaded
|
||||||
// and 'background' or 't_Co' is changed.
|
// and 'background' or 't_Co' is changed.
|
||||||
@@ -6235,9 +6234,9 @@ init_highlight(int both, int reset)
|
|||||||
* Didn't use a color file, use the compiled-in colors.
|
* Didn't use a color file, use the compiled-in colors.
|
||||||
*/
|
*/
|
||||||
if (both) {
|
if (both) {
|
||||||
had_both = TRUE;
|
had_both = true;
|
||||||
const char *const *const pp = highlight_init_both;
|
const char *const *const pp = highlight_init_both;
|
||||||
for (i = 0; pp[i] != NULL; i++) {
|
for (size_t i = 0; pp[i] != NULL; i++) {
|
||||||
do_highlight(pp[i], reset, true);
|
do_highlight(pp[i], reset, true);
|
||||||
}
|
}
|
||||||
} else if (!had_both) {
|
} else if (!had_both) {
|
||||||
@@ -6250,7 +6249,7 @@ init_highlight(int both, int reset)
|
|||||||
const char *const *const pp = ((*p_bg == 'l')
|
const char *const *const pp = ((*p_bg == 'l')
|
||||||
? highlight_init_light
|
? highlight_init_light
|
||||||
: highlight_init_dark);
|
: highlight_init_dark);
|
||||||
for (i = 0; pp[i] != NULL; i++) {
|
for (size_t i = 0; pp[i] != NULL; i++) {
|
||||||
do_highlight(pp[i], reset, true);
|
do_highlight(pp[i], reset, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6266,9 +6265,10 @@ init_highlight(int both, int reset)
|
|||||||
: "Visual cterm=NONE ctermbg=DarkGrey"), false, true);
|
: "Visual cterm=NONE ctermbg=DarkGrey"), false, true);
|
||||||
} else {
|
} else {
|
||||||
do_highlight("Visual cterm=reverse ctermbg=NONE", false, true);
|
do_highlight("Visual cterm=reverse ctermbg=NONE", false, true);
|
||||||
if (*p_bg == 'l')
|
if (*p_bg == 'l') {
|
||||||
do_highlight("Search ctermfg=black", false, true);
|
do_highlight("Search ctermfg=black", false, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If syntax highlighting is enabled load the highlighting for it.
|
* If syntax highlighting is enabled load the highlighting for it.
|
||||||
@@ -6452,7 +6452,7 @@ void do_highlight(const char *line, const bool forceit, const bool init)
|
|||||||
restore_cterm_colors();
|
restore_cterm_colors();
|
||||||
|
|
||||||
// Clear all default highlight groups and load the defaults.
|
// Clear all default highlight groups and load the defaults.
|
||||||
for (int idx = 0; idx < highlight_ga.ga_len; ++idx) {
|
for (int idx = 0; idx < highlight_ga.ga_len; idx++) {
|
||||||
highlight_clear(idx);
|
highlight_clear(idx);
|
||||||
}
|
}
|
||||||
init_highlight(true, true);
|
init_highlight(true, true);
|
||||||
@@ -6690,8 +6690,7 @@ void do_highlight(const char *line, const bool forceit, const bool init)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
emsgf(_(
|
emsgf(_("E421: Color name or number not recognized: %s"),
|
||||||
"E421: Color name or number not recognized: %s"),
|
|
||||||
key_start);
|
key_start);
|
||||||
error = true;
|
error = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -2853,7 +2853,7 @@ viml_pexpr_parse_end:
|
|||||||
}
|
}
|
||||||
kvi_destroy(ast_stack);
|
kvi_destroy(ast_stack);
|
||||||
return ast;
|
return ast;
|
||||||
}
|
} // NOLINT(readability/fn_size)
|
||||||
|
|
||||||
#undef NEW_NODE
|
#undef NEW_NODE
|
||||||
#undef HL
|
#undef HL
|
||||||
|
|||||||
Reference in New Issue
Block a user