mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Fix linting errors.
This commit is contained in:
parent
c3ac16cfeb
commit
ad34a376eb
@ -6589,7 +6589,7 @@ void fixthisline(IndentGetter get_the_indent)
|
|||||||
if (amount >= 0) {
|
if (amount >= 0) {
|
||||||
change_indent(INDENT_SET, amount, false, 0, true);
|
change_indent(INDENT_SET, amount, false, 0, true);
|
||||||
if (linewhite(curwin->w_cursor.lnum)) {
|
if (linewhite(curwin->w_cursor.lnum)) {
|
||||||
did_ai = TRUE; // delete the indent if the line stays empty
|
did_ai = true; // delete the indent if the line stays empty
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,9 +159,7 @@ static char_u *skip_string(char_u *p)
|
|||||||
}
|
}
|
||||||
if (p[0] == '"')
|
if (p[0] == '"')
|
||||||
continue; /* continue for another string */
|
continue; /* continue for another string */
|
||||||
}
|
} else if (p[0] == 'R' && p[1] == '"') {
|
||||||
else if (p[0] == 'R' && p[1] == '"')
|
|
||||||
{
|
|
||||||
/* Raw string: R"[delim](...)[delim]" */
|
/* Raw string: R"[delim](...)[delim]" */
|
||||||
char_u *delim = p + 2;
|
char_u *delim = p + 2;
|
||||||
char_u *paren = vim_strchr(delim, '(');
|
char_u *paren = vim_strchr(delim, '(');
|
||||||
@ -1748,7 +1746,7 @@ int get_c_indent(void)
|
|||||||
/*
|
/*
|
||||||
* #defines and so on always go at the left when included in 'cinkeys'.
|
* #defines and so on always go at the left when included in 'cinkeys'.
|
||||||
*/
|
*/
|
||||||
if (*theline == '#' && (*linecopy == '#' || in_cinkeys('#', ' ', TRUE))) {
|
if (*theline == '#' && (*linecopy == '#' || in_cinkeys('#', ' ', true))) {
|
||||||
amount = curbuf->b_ind_hash_comment;
|
amount = curbuf->b_ind_hash_comment;
|
||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
@ -1842,13 +1840,13 @@ int get_c_indent(void)
|
|||||||
lead_middle_len) == 0) {
|
lead_middle_len) == 0) {
|
||||||
amount = get_indent_lnum(curwin->w_cursor.lnum - 1);
|
amount = get_indent_lnum(curwin->w_cursor.lnum - 1);
|
||||||
break;
|
break;
|
||||||
}
|
} else if (STRNCMP(ml_get(comment_pos->lnum) + comment_pos->col,
|
||||||
|
lead_start, lead_start_len) != 0) {
|
||||||
/* If the start comment string doesn't match with the
|
/* If the start comment string doesn't match with the
|
||||||
* start of the comment, skip this entry. XXX */
|
* start of the comment, skip this entry. XXX */
|
||||||
else if (STRNCMP(ml_get(comment_pos->lnum) + comment_pos->col,
|
|
||||||
lead_start, lead_start_len) != 0)
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (start_off != 0)
|
if (start_off != 0)
|
||||||
amount += start_off;
|
amount += start_off;
|
||||||
else if (start_align == COM_RIGHT)
|
else if (start_align == COM_RIGHT)
|
||||||
@ -3225,7 +3223,7 @@ term_again:
|
|||||||
&& !cin_ends_in(theline, (char_u *)",", NULL)
|
&& !cin_ends_in(theline, (char_u *)",", NULL)
|
||||||
&& cin_isfuncdecl(NULL, cur_curpos.lnum + 1,
|
&& cin_isfuncdecl(NULL, cur_curpos.lnum + 1,
|
||||||
cur_curpos.lnum + 1)
|
cur_curpos.lnum + 1)
|
||||||
&& !cin_isterminated(theline, FALSE, TRUE)) {
|
&& !cin_isterminated(theline, false, true)) {
|
||||||
amount = curbuf->b_ind_func_type;
|
amount = curbuf->b_ind_func_type;
|
||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
@ -3253,7 +3251,7 @@ term_again:
|
|||||||
* Are we at the start of a cpp base class declaration or
|
* Are we at the start of a cpp base class declaration or
|
||||||
* constructor initialization?
|
* constructor initialization?
|
||||||
*/ /* XXX */
|
*/ /* XXX */
|
||||||
n = FALSE;
|
n = false;
|
||||||
if (curbuf->b_ind_cpp_baseclass != 0 && theline[0] != '{') {
|
if (curbuf->b_ind_cpp_baseclass != 0 && theline[0] != '{') {
|
||||||
n = cin_is_cpp_baseclass(&cache_cpp_baseclass);
|
n = cin_is_cpp_baseclass(&cache_cpp_baseclass);
|
||||||
l = get_cursor_line_ptr();
|
l = get_cursor_line_ptr();
|
||||||
|
@ -1452,14 +1452,14 @@ static int find_rawstring_end(char_u *linep, pos_T *startpos, pos_T *endpos)
|
|||||||
char_u *delim_copy;
|
char_u *delim_copy;
|
||||||
size_t delim_len;
|
size_t delim_len;
|
||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
int found = FALSE;
|
int found = false;
|
||||||
|
|
||||||
|
for (p = linep + startpos->col + 1; *p && *p != '('; ++p) {}
|
||||||
|
|
||||||
for (p = linep + startpos->col + 1; *p && *p != '('; ++p)
|
|
||||||
;
|
|
||||||
delim_len = (p - linep) - startpos->col - 1;
|
delim_len = (p - linep) - startpos->col - 1;
|
||||||
delim_copy = vim_strnsave(linep + startpos->col + 1, delim_len);
|
delim_copy = vim_strnsave(linep + startpos->col + 1, delim_len);
|
||||||
if (delim_copy == NULL)
|
if (delim_copy == NULL)
|
||||||
return FALSE;
|
return false;
|
||||||
for (lnum = startpos->lnum; lnum <= endpos->lnum; ++lnum)
|
for (lnum = startpos->lnum; lnum <= endpos->lnum; ++lnum)
|
||||||
{
|
{
|
||||||
char_u *line = ml_get(lnum);
|
char_u *line = ml_get(lnum);
|
||||||
@ -1472,7 +1472,7 @@ static int find_rawstring_end(char_u *linep, pos_T *startpos, pos_T *endpos)
|
|||||||
if (*p == ')' && p[delim_len + 1] == '"'
|
if (*p == ')' && p[delim_len + 1] == '"'
|
||||||
&& STRNCMP(delim_copy, p + 1, delim_len) == 0)
|
&& STRNCMP(delim_copy, p + 1, delim_len) == 0)
|
||||||
{
|
{
|
||||||
found = TRUE;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1510,9 +1510,9 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
|
|||||||
int findc = 0; /* matching brace */
|
int findc = 0; /* matching brace */
|
||||||
int c;
|
int c;
|
||||||
int count = 0; /* cumulative number of braces */
|
int count = 0; /* cumulative number of braces */
|
||||||
int backwards = FALSE; /* init for gcc */
|
int backwards = false; /* init for gcc */
|
||||||
int raw_string = FALSE; /* search for raw string */
|
int raw_string = false; /* search for raw string */
|
||||||
int inquote = FALSE; /* TRUE when inside quotes */
|
int inquote = false; /* true when inside quotes */
|
||||||
char_u *linep; /* pointer to current line */
|
char_u *linep; /* pointer to current line */
|
||||||
char_u *ptr;
|
char_u *ptr;
|
||||||
int do_quotes; /* check for quotes in current line */
|
int do_quotes; /* check for quotes in current line */
|
||||||
@ -1555,16 +1555,15 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
|
|||||||
if (initc == '/' || initc == '*' || initc == 'R') {
|
if (initc == '/' || initc == '*' || initc == 'R') {
|
||||||
comment_dir = dir;
|
comment_dir = dir;
|
||||||
if (initc == '/')
|
if (initc == '/')
|
||||||
ignore_cend = TRUE;
|
ignore_cend = true;
|
||||||
backwards = (dir == FORWARD) ? FALSE : TRUE;
|
backwards = (dir == FORWARD) ? false : true;
|
||||||
raw_string = (initc == 'R');
|
raw_string = (initc == 'R');
|
||||||
initc = NUL;
|
initc = NUL;
|
||||||
} else if (initc != '#' && initc != NUL) {
|
} else if (initc != '#' && initc != NUL) {
|
||||||
find_mps_values(&initc, &findc, &backwards, TRUE);
|
find_mps_values(&initc, &findc, &backwards, TRUE);
|
||||||
if (findc == NUL)
|
if (findc == NUL)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
/*
|
/*
|
||||||
* Either initc is '#', or no initc was given and we need to look
|
* Either initc is '#', or no initc was given and we need to look
|
||||||
* under the cursor.
|
* under the cursor.
|
||||||
@ -1832,8 +1831,7 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
|
|||||||
}
|
}
|
||||||
linep = ml_get(pos.lnum); /* may have been released */
|
linep = ml_get(pos.lnum); /* may have been released */
|
||||||
}
|
}
|
||||||
}
|
} else if ( linep[pos.col - 1] == '/'
|
||||||
else if ( linep[pos.col - 1] == '/'
|
|
||||||
&& linep[pos.col] == '*'
|
&& linep[pos.col] == '*'
|
||||||
&& (int)pos.col < comment_col) {
|
&& (int)pos.col < comment_col) {
|
||||||
count++;
|
count++;
|
||||||
|
Loading…
Reference in New Issue
Block a user