tweaks: reindent and rewrap a few lines, and shorten a comment
parent
115aeda69b
commit
a9f79a6130
|
@ -434,7 +434,7 @@ int parse_mbchar(const char *buf, char *chr, size_t *col)
|
||||||
(*col)++;
|
(*col)++;
|
||||||
|
|
||||||
ctrl_buf_mb = control_mbrep(buf, ctrl_buf_mb,
|
ctrl_buf_mb = control_mbrep(buf, ctrl_buf_mb,
|
||||||
&ctrl_buf_mb_len);
|
&ctrl_buf_mb_len);
|
||||||
|
|
||||||
*col += mbwidth(ctrl_buf_mb);
|
*col += mbwidth(ctrl_buf_mb);
|
||||||
|
|
||||||
|
@ -459,10 +459,8 @@ int parse_mbchar(const char *buf, char *chr, size_t *col)
|
||||||
* current value of col. */
|
* current value of col. */
|
||||||
if (*buf == '\t')
|
if (*buf == '\t')
|
||||||
*col += tabsize - *col % tabsize;
|
*col += tabsize - *col % tabsize;
|
||||||
/* If we have a control character, it's two columns wide:
|
/* If we have a control character, it's two columns wide: one
|
||||||
* one column for the "^" that will be displayed in front of
|
* column for the "^", and one for the visible character. */
|
||||||
* it, and one column for its visible equivalent as returned
|
|
||||||
* by control_mbrep(). */
|
|
||||||
else if (is_cntrl_char((unsigned char)*buf))
|
else if (is_cntrl_char((unsigned char)*buf))
|
||||||
*col += 2;
|
*col += 2;
|
||||||
/* If we have a normal character, it's one column wide. */
|
/* If we have a normal character, it's one column wide. */
|
||||||
|
|
|
@ -1796,7 +1796,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
|
||||||
int ctrl_buf_mb_len, i;
|
int ctrl_buf_mb_len, i;
|
||||||
|
|
||||||
ctrl_buf_mb = control_mbrep(buf_mb, ctrl_buf_mb,
|
ctrl_buf_mb = control_mbrep(buf_mb, ctrl_buf_mb,
|
||||||
&ctrl_buf_mb_len);
|
&ctrl_buf_mb_len);
|
||||||
|
|
||||||
for (i = 0; i < ctrl_buf_mb_len; i++)
|
for (i = 0; i < ctrl_buf_mb_len; i++)
|
||||||
converted[index++] = ctrl_buf_mb[i];
|
converted[index++] = ctrl_buf_mb[i];
|
||||||
|
@ -1861,8 +1861,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
|
||||||
converted[index++] = '^';
|
converted[index++] = '^';
|
||||||
start_col++;
|
start_col++;
|
||||||
|
|
||||||
ctrl_buf_mb = control_mbrep(buf_mb, ctrl_buf_mb,
|
ctrl_buf_mb = control_mbrep(buf_mb, ctrl_buf_mb, &ctrl_buf_mb_len);
|
||||||
&ctrl_buf_mb_len);
|
|
||||||
|
|
||||||
for (i = 0; i < ctrl_buf_mb_len; i++)
|
for (i = 0; i < ctrl_buf_mb_len; i++)
|
||||||
converted[index++] = ctrl_buf_mb[i];
|
converted[index++] = ctrl_buf_mb[i];
|
||||||
|
@ -1896,9 +1895,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
|
||||||
if (using_utf8() && buf_mb_len == 1)
|
if (using_utf8() && buf_mb_len == 1)
|
||||||
buf_mb[1] = '\0';
|
buf_mb[1] = '\0';
|
||||||
#endif
|
#endif
|
||||||
|
nctrl_buf_mb = mbrep(buf_mb, nctrl_buf_mb, &nctrl_buf_mb_len);
|
||||||
nctrl_buf_mb = mbrep(buf_mb, nctrl_buf_mb,
|
|
||||||
&nctrl_buf_mb_len);
|
|
||||||
|
|
||||||
for (i = 0; i < nctrl_buf_mb_len; i++)
|
for (i = 0; i < nctrl_buf_mb_len; i++)
|
||||||
converted[index++] = nctrl_buf_mb[i];
|
converted[index++] = nctrl_buf_mb[i];
|
||||||
|
|
Loading…
Reference in New Issue