Merge pull request #18425 from dundargoc/refactor/char_u/1

refactor: replace char_u variables and functions with char
This commit is contained in:
bfredl
2022-05-07 16:40:00 +02:00
committed by GitHub
51 changed files with 508 additions and 506 deletions

View File

@@ -586,7 +586,7 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer
String c = opts->conceal.data.string;
decor.conceal = true;
if (c.size) {
decor.conceal_char = utf_ptr2char((const char_u *)c.data);
decor.conceal_char = utf_ptr2char(c.data);
}
has_decor = true;
} else if (HAS_KEY(opts->conceal)) {

View File

@@ -654,9 +654,9 @@ void modify_keymap(uint64_t channel_id, Buffer buffer, bool is_unmap, String mod
int mode_val; // integer value of the mapping mode, to be passed to do_map()
char *p = (mode.size) ? mode.data : "m";
if (STRNCMP(p, "!", 2) == 0) {
mode_val = get_map_mode((char_u **)&p, true); // mapmode-ic
mode_val = get_map_mode(&p, true); // mapmode-ic
} else {
mode_val = get_map_mode((char_u **)&p, false);
mode_val = get_map_mode(&p, false);
if ((mode_val == VISUAL + SELECTMODE + NORMAL + OP_PENDING)
&& mode.size > 0) {
// get_map_mode() treats unrecognized mode shortnames as ":map".
@@ -1128,7 +1128,7 @@ ArrayOf(Dictionary) keymap_array(String mode, buf_T *buf, bool from_lua)
// Convert the string mode to the integer mode
// that is stored within each mapblock
char_u *p = (char_u *)mode.data;
char *p = mode.data;
int int_mode = get_map_mode(&p, 0);
// Determine the desired buffer value
@@ -1666,11 +1666,11 @@ int init_sign_text(char **sign_text, char *text)
// Count cells and check for non-printable chars
int cells = 0;
for (s = text; s < endp; s += utfc_ptr2len((char_u *)s)) {
if (!vim_isprintc(utf_ptr2char((char_u *)s))) {
for (s = text; s < endp; s += utfc_ptr2len(s)) {
if (!vim_isprintc(utf_ptr2char(s))) {
break;
}
cells += utf_ptr2cells((char_u *)s);
cells += utf_ptr2cells(s);
}
// Currently must be empty, one or two display cells
if (s != endp || cells > 2) {

View File

@@ -665,7 +665,7 @@ static void remote_ui_raw_line(UI *ui, Integer grid, Integer row, Integer startc
remote_ui_cursor_goto(ui, row, startcol + i);
remote_ui_highlight_set(ui, attrs[i]);
remote_ui_put(ui, (const char *)chunk[i]);
if (utf_ambiguous_width(utf_ptr2char(chunk[i]))) {
if (utf_ambiguous_width(utf_ptr2char((char *)chunk[i]))) {
data->client_col = -1; // force cursor update
}
}

View File

@@ -2287,12 +2287,12 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error *
if (HAS_KEY(opts->fillchar)) {
if (opts->fillchar.type != kObjectTypeString || opts->fillchar.data.string.size == 0
|| ((size_t)utf_ptr2len((char_u *)opts->fillchar.data.string.data)
|| ((size_t)utf_ptr2len(opts->fillchar.data.string.data)
!= opts->fillchar.data.string.size)) {
api_set_error(err, kErrorTypeValidation, "fillchar must be a single character");
return result;
}
fillchar = utf_ptr2char((char_u *)opts->fillchar.data.string.data);
fillchar = utf_ptr2char(opts->fillchar.data.string.data);
}
if (HAS_KEY(opts->highlights)) {