lint: clean-up after parent commits

This commit is contained in:
ZviRackover 2018-08-29 23:32:57 +03:00
parent 1015aa6ff3
commit a3549286b2
4 changed files with 23 additions and 19 deletions

View File

@ -2154,8 +2154,9 @@ static void correct_cmdspos(int idx, int cells)
{
if (utfc_ptr2len(ccline.cmdbuff + idx) > 1
&& utf_ptr2cells(ccline.cmdbuff + idx) > 1
&& ccline.cmdspos % Columns + cells > Columns)
&& ccline.cmdspos % Columns + cells > Columns) {
ccline.cmdspos++;
}
}
/*

View File

@ -898,7 +898,7 @@ char_u *replace_termcodes(const char_u *from, const size_t from_len,
}
// skip multibyte char correctly
for (i = utfc_ptr2len_len(src, (int) (end - src) + 1); i > 0; i--) {
for (i = utfc_ptr2len_len(src, (int)(end - src) + 1); i > 0; i--) {
// If the character is K_SPECIAL, replace it with K_SPECIAL
// KS_SPECIAL KE_FILLER.
// If compiled with the GUI replace CSI with K_CSI.

View File

@ -2124,8 +2124,9 @@ static char_u *iconv_string(const vimconv_T *const vcp, char_u *str,
* conversion from 'encoding' to something else. In other
* situations we don't know what to skip anyway. */
*to++ = '?';
if (utf_ptr2cells((char_u *)from) > 1)
if (utf_ptr2cells((char_u *)from) > 1) {
*to++ = '?';
}
l = utfc_ptr2len_len((const char_u *)from, (int)fromlen);
from += l;
fromlen -= l;

View File

@ -2917,13 +2917,14 @@ win_line (
|| (vcol + 1 == fromcol && n_extra == 0
&& utf_ptr2cells(ptr) > 1)
|| ((int)vcol_prev == fromcol_prev
&& vcol_prev < vcol /* not at margin */
&& vcol < tocol))
area_attr = attr; /* start highlighting */
else if (area_attr != 0
&& (vcol == tocol
|| (noinvcur && (colnr_T)vcol == wp->w_virtcol)))
area_attr = 0; /* stop highlighting */
&& vcol_prev < vcol // not at margin
&& vcol < tocol)) {
area_attr = attr; // start highlighting
} else if (area_attr != 0 && (vcol == tocol
|| (noinvcur
&& (colnr_T)vcol == wp->w_virtcol))) {
area_attr = 0; // stop highlighting
}
if (!n_extra) {
/*
@ -6128,15 +6129,16 @@ void setcursor(void)
{
if (redrawing()) {
validate_cursor();
int left_offset = curwin->w_wcol;
if (curwin->w_p_rl) {
// With 'rightleft' set and the cursor on a double-wide character,
// position it on the leftmost column.
left_offset = curwin->w_width - curwin->w_wcol
- ((utf_ptr2cells(get_cursor_pos_ptr()) == 2
&& vim_isprintc(gchar_cursor())) ? 2 : 1);
}
ui_cursor_goto(curwin->w_winrow + curwin->w_wrow,
curwin->w_wincol + (
/* With 'rightleft' set and the cursor on a double-wide
* character, position it on the leftmost column. */
curwin->w_p_rl ? (curwin->w_width - curwin->w_wcol - (
(utf_ptr2cells(get_cursor_pos_ptr()) == 2
&& vim_isprintc(gchar_cursor())) ? 2 :
1)) :
curwin->w_wcol));
curwin->w_wincol + left_offset);
}
}
@ -6967,7 +6969,7 @@ static void win_redr_ruler(win_T *wp, int always)
}
get_rel_pos(wp, buffer + i, RULER_BUF_LEN - i);
}
/* Truncate at window boundary. */
// Truncate at window boundary.
o = 0;
for (i = 0; buffer[i] != NUL; i += utfc_ptr2len(buffer + i)) {
o += utf_ptr2cells(buffer + i);