aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/drawline.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-01-09 17:37:21 +0800
committerGitHub <noreply@github.com>2023-01-09 17:37:21 +0800
commitd64549bc4e795cabca270f91b483ba9df7006b85 (patch)
tree851c079d82cc3c20d08eb82a88a2b59a0e24d5e2 /src/nvim/drawline.c
parent53adccb6e0292f7ba5524121c0200a73aec977a6 (diff)
parent7ba39b4378743ceefdd52186e64acd6af6f8e5a2 (diff)
downloadrneovim-d64549bc4e795cabca270f91b483ba9df7006b85.tar.gz
rneovim-d64549bc4e795cabca270f91b483ba9df7006b85.tar.bz2
rneovim-d64549bc4e795cabca270f91b483ba9df7006b85.zip
Merge pull request #21488 from dundargoc/refactor/char_u/16.1
refactor/char u/16.1
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r--src/nvim/drawline.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 74e493926f..9669c0c9a1 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -137,39 +137,39 @@ static void margin_columns_win(win_T *wp, int *left_col, int *right_col)
/// Handles composing chars and arabic shaping state.
static int line_putchar(buf_T *buf, LineState *s, schar_T *dest, int maxcells, bool rl, int vcol)
{
- const char_u *p = (char_u *)s->p;
- int cells = utf_ptr2cells((char *)p);
- int c_len = utfc_ptr2len((char *)p);
+ const char *p = s->p;
+ int cells = utf_ptr2cells(p);
+ int c_len = utfc_ptr2len(p);
int u8c, u8cc[MAX_MCO];
if (cells > maxcells) {
return -1;
}
- u8c = utfc_ptr2char((char *)p, u8cc);
+ u8c = utfc_ptr2char(p, u8cc);
if (*p == TAB) {
cells = MIN(tabstop_padding(vcol, buf->b_p_ts, buf->b_p_vts_array), maxcells);
for (int c = 0; c < cells; c++) {
schar_from_ascii(dest[c], ' ');
}
goto done;
- } else if (*p < 0x80 && u8cc[0] == 0) {
- schar_from_ascii(dest[0], (char)(*p));
+ } else if ((uint8_t)(*p) < 0x80 && u8cc[0] == 0) {
+ schar_from_ascii(dest[0], *p);
s->prev_c = u8c;
} else {
if (p_arshape && !p_tbidi && ARABIC_CHAR(u8c)) {
// Do Arabic shaping.
int pc, pc1, nc;
int pcc[MAX_MCO];
- int firstbyte = *p;
+ int firstbyte = (uint8_t)(*p);
// The idea of what is the previous and next
// character depends on 'rightleft'.
if (rl) {
pc = s->prev_c;
pc1 = s->prev_c1;
- nc = utf_ptr2char((char *)p + c_len);
+ nc = utf_ptr2char(p + c_len);
s->prev_c1 = u8cc[0];
} else {
- pc = utfc_ptr2char((char *)p + c_len, pcc);
+ pc = utfc_ptr2char(p + c_len, pcc);
nc = s->prev_c;
pc1 = pcc[0];
}