chars: the representation of control characters is always two columns wide
Этот коммит содержится в:
родитель
a9f79a6130
Коммит
4172268bd2
18
src/chars.c
18
src/chars.c
@ -423,22 +423,10 @@ 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, get its width using one
|
/* If we have a control character, it's two columns wide: one
|
||||||
* column for the "^" that will be displayed in front of it,
|
* column for the "^", and one for the visible character. */
|
||||||
* and the width in columns of its visible equivalent as
|
|
||||||
* returned by control_mbrep(). */
|
|
||||||
else if (is_cntrl_mbchar(buf)) {
|
else if (is_cntrl_mbchar(buf)) {
|
||||||
char *ctrl_buf_mb = charalloc(MB_CUR_MAX);
|
*col += 2;
|
||||||
int ctrl_buf_mb_len;
|
|
||||||
|
|
||||||
(*col)++;
|
|
||||||
|
|
||||||
ctrl_buf_mb = control_mbrep(buf, ctrl_buf_mb,
|
|
||||||
&ctrl_buf_mb_len);
|
|
||||||
|
|
||||||
*col += mbwidth(ctrl_buf_mb);
|
|
||||||
|
|
||||||
free(ctrl_buf_mb);
|
|
||||||
/* If we have a normal character, get its width in columns
|
/* If we have a normal character, get its width in columns
|
||||||
* normally. */
|
* normally. */
|
||||||
} else
|
} else
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user