style: indent, then lint

This commit is contained in:
Justin M. Keyes
2018-09-13 01:18:12 +02:00
parent ba27284f07
commit 021f67df12

View File

@@ -2264,17 +2264,17 @@ win_line (
// trailing white space and/or syntax processing to be done. // trailing white space and/or syntax processing to be done.
extra_check = wp->w_p_lbr; extra_check = wp->w_p_lbr;
if (syntax_present(wp) && !wp->w_s->b_syn_error) { if (syntax_present(wp) && !wp->w_s->b_syn_error) {
/* Prepare for syntax highlighting in this line. When there is an // Prepare for syntax highlighting in this line. When there is an
* error, stop syntax highlighting. */ // error, stop syntax highlighting.
save_did_emsg = did_emsg; save_did_emsg = did_emsg;
did_emsg = FALSE; did_emsg = false;
syntax_start(wp, lnum); syntax_start(wp, lnum);
if (did_emsg) if (did_emsg) {
wp->w_s->b_syn_error = TRUE; wp->w_s->b_syn_error = true;
else { } else {
did_emsg = save_did_emsg; did_emsg = save_did_emsg;
has_syntax = TRUE; has_syntax = true;
extra_check = TRUE; extra_check = true;
} }
} }
@@ -2283,128 +2283,132 @@ win_line (
extra_check = true; extra_check = true;
} }
/* Check for columns to display for 'colorcolumn'. */ // Check for columns to display for 'colorcolumn'.
color_cols = wp->w_buffer->terminal ? NULL : wp->w_p_cc_cols; color_cols = wp->w_buffer->terminal ? NULL : wp->w_p_cc_cols;
if (color_cols != NULL) if (color_cols != NULL) {
draw_color_col = advance_color_col(VCOL_HLC, &color_cols); draw_color_col = advance_color_col(VCOL_HLC, &color_cols);
}
if (wp->w_p_spell if (wp->w_p_spell
&& *wp->w_s->b_p_spl != NUL && *wp->w_s->b_p_spl != NUL
&& !GA_EMPTY(&wp->w_s->b_langp) && !GA_EMPTY(&wp->w_s->b_langp)
&& *(char **)(wp->w_s->b_langp.ga_data) != NULL) { && *(char **)(wp->w_s->b_langp.ga_data) != NULL) {
/* Prepare for spell checking. */ // Prepare for spell checking.
has_spell = true; has_spell = true;
extra_check = TRUE; extra_check = true;
/* Get the start of the next line, so that words that wrap to the next // Get the start of the next line, so that words that wrap to the next
* line are found too: "et<line-break>al.". // line are found too: "et<line-break>al.".
* Trick: skip a few chars for C/shell/Vim comments */ // Trick: skip a few chars for C/shell/Vim comments
nextline[SPWORDLEN] = NUL; nextline[SPWORDLEN] = NUL;
if (lnum < wp->w_buffer->b_ml.ml_line_count) { if (lnum < wp->w_buffer->b_ml.ml_line_count) {
line = ml_get_buf(wp->w_buffer, lnum + 1, FALSE); line = ml_get_buf(wp->w_buffer, lnum + 1, false);
spell_cat_line(nextline + SPWORDLEN, line, SPWORDLEN); spell_cat_line(nextline + SPWORDLEN, line, SPWORDLEN);
} }
/* When a word wrapped from the previous line the start of the current // When a word wrapped from the previous line the start of the current
* line is valid. */ // line is valid.
if (lnum == checked_lnum) if (lnum == checked_lnum) {
cur_checked_col = checked_col; cur_checked_col = checked_col;
}
checked_lnum = 0; checked_lnum = 0;
/* When there was a sentence end in the previous line may require a // When there was a sentence end in the previous line may require a
* word starting with capital in this line. In line 1 always check // word starting with capital in this line. In line 1 always check
* the first word. */ // the first word.
if (lnum != capcol_lnum) if (lnum != capcol_lnum) {
cap_col = -1; cap_col = -1;
if (lnum == 1) }
if (lnum == 1) {
cap_col = 0; cap_col = 0;
}
capcol_lnum = 0; capcol_lnum = 0;
} }
/* //
* handle visual active in this window // handle visual active in this window
*/ //
fromcol = -10; fromcol = -10;
tocol = MAXCOL; tocol = MAXCOL;
if (VIsual_active && wp->w_buffer == curwin->w_buffer) { if (VIsual_active && wp->w_buffer == curwin->w_buffer) {
/* Visual is after curwin->w_cursor */ // Visual is after curwin->w_cursor
if (ltoreq(curwin->w_cursor, VIsual)) { if (ltoreq(curwin->w_cursor, VIsual)) {
top = &curwin->w_cursor; top = &curwin->w_cursor;
bot = &VIsual; bot = &VIsual;
} else { /* Visual is before curwin->w_cursor */ } else { // Visual is before curwin->w_cursor
top = &VIsual; top = &VIsual;
bot = &curwin->w_cursor; bot = &curwin->w_cursor;
} }
lnum_in_visual_area = (lnum >= top->lnum && lnum <= bot->lnum); lnum_in_visual_area = (lnum >= top->lnum && lnum <= bot->lnum);
if (VIsual_mode == Ctrl_V) { /* block mode */ if (VIsual_mode == Ctrl_V) { // block mode
if (lnum_in_visual_area) { if (lnum_in_visual_area) {
fromcol = wp->w_old_cursor_fcol; fromcol = wp->w_old_cursor_fcol;
tocol = wp->w_old_cursor_lcol; tocol = wp->w_old_cursor_lcol;
} }
} else { /* non-block mode */ } else { // non-block mode
if (lnum > top->lnum && lnum <= bot->lnum) if (lnum > top->lnum && lnum <= bot->lnum) {
fromcol = 0; fromcol = 0;
else if (lnum == top->lnum) { } else if (lnum == top->lnum) {
if (VIsual_mode == 'V') /* linewise */ if (VIsual_mode == 'V') { // linewise
fromcol = 0; fromcol = 0;
else { } else {
getvvcol(wp, top, (colnr_T *)&fromcol, NULL, NULL); getvvcol(wp, top, (colnr_T *)&fromcol, NULL, NULL);
if (gchar_pos(top) == NUL) if (gchar_pos(top) == NUL) {
tocol = fromcol + 1; tocol = fromcol + 1;
} }
} }
}
if (VIsual_mode != 'V' && lnum == bot->lnum) { if (VIsual_mode != 'V' && lnum == bot->lnum) {
if (*p_sel == 'e' && bot->col == 0 if (*p_sel == 'e' && bot->col == 0
&& bot->coladd == 0 && bot->coladd == 0) {
) {
fromcol = -10; fromcol = -10;
tocol = MAXCOL; tocol = MAXCOL;
} else if (bot->col == MAXCOL) } else if (bot->col == MAXCOL) {
tocol = MAXCOL; tocol = MAXCOL;
else { } else {
pos = *bot; pos = *bot;
if (*p_sel == 'e') if (*p_sel == 'e') {
getvvcol(wp, &pos, (colnr_T *)&tocol, NULL, NULL); getvvcol(wp, &pos, (colnr_T *)&tocol, NULL, NULL);
else { } else {
getvvcol(wp, &pos, NULL, NULL, (colnr_T *)&tocol); getvvcol(wp, &pos, NULL, NULL, (colnr_T *)&tocol);
++tocol; tocol++;
} }
} }
} }
} }
/* Check if the character under the cursor should not be inverted */ // Check if the character under the cursor should not be inverted
if (!highlight_match && lnum == curwin->w_cursor.lnum && wp == curwin if (!highlight_match && lnum == curwin->w_cursor.lnum && wp == curwin) {
) noinvcur = true;
noinvcur = TRUE; }
/* if inverting in this line set area_highlighting */ // if inverting in this line set area_highlighting
if (fromcol >= 0) { if (fromcol >= 0) {
area_highlighting = true; area_highlighting = true;
attr = win_hl_attr(wp, HLF_V); attr = win_hl_attr(wp, HLF_V);
} }
} // handle 'incsearch' and ":s///c" highlighting
/* } else if (highlight_match
* handle 'incsearch' and ":s///c" highlighting
*/
else if (highlight_match
&& wp == curwin && wp == curwin
&& lnum >= curwin->w_cursor.lnum && lnum >= curwin->w_cursor.lnum
&& lnum <= curwin->w_cursor.lnum + search_match_lines) { && lnum <= curwin->w_cursor.lnum + search_match_lines) {
if (lnum == curwin->w_cursor.lnum) if (lnum == curwin->w_cursor.lnum) {
getvcol(curwin, &(curwin->w_cursor), getvcol(curwin, &(curwin->w_cursor),
(colnr_T *)&fromcol, NULL, NULL); (colnr_T *)&fromcol, NULL, NULL);
else } else {
fromcol = 0; fromcol = 0;
}
if (lnum == curwin->w_cursor.lnum + search_match_lines) { if (lnum == curwin->w_cursor.lnum + search_match_lines) {
pos.lnum = lnum; pos.lnum = lnum;
pos.col = search_match_endcol; pos.col = search_match_endcol;
getvcol(curwin, &pos, (colnr_T *)&tocol, NULL, NULL); getvcol(curwin, &pos, (colnr_T *)&tocol, NULL, NULL);
} else } else {
tocol = MAXCOL; tocol = MAXCOL;
/* do at least one character; happens when past end of line */ }
if (fromcol == tocol) // do at least one character; happens when past end of line
if (fromcol == tocol) {
tocol = fromcol + 1; tocol = fromcol + 1;
}
area_highlighting = true; area_highlighting = true;
attr = win_hl_attr(wp, HLF_I); attr = win_hl_attr(wp, HLF_I);
} }