mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 06:16:08 +00:00
refactor: replace char_u with char 22 (#21786)
Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
@@ -598,7 +598,7 @@ static char *ins_compl_infercase_gettext(const char *str, int char_len, int comp
|
||||
// Allocate wide character array for the completion and fill it.
|
||||
int *const wca = xmalloc((size_t)char_len * sizeof(*wca));
|
||||
{
|
||||
const char_u *p = (char_u *)str;
|
||||
const char *p = str;
|
||||
for (int i = 0; i < char_len; i++) {
|
||||
wca[i] = mb_ptr2char_adv(&p);
|
||||
}
|
||||
@@ -606,7 +606,7 @@ static char *ins_compl_infercase_gettext(const char *str, int char_len, int comp
|
||||
|
||||
// Rule 1: Were any chars converted to lower?
|
||||
{
|
||||
const char_u *p = (char_u *)compl_orig_text;
|
||||
const char *p = compl_orig_text;
|
||||
for (int i = 0; i < min_len; i++) {
|
||||
const int c = mb_ptr2char_adv(&p);
|
||||
if (mb_islower(c)) {
|
||||
@@ -625,7 +625,7 @@ static char *ins_compl_infercase_gettext(const char *str, int char_len, int comp
|
||||
// Rule 2: No lower case, 2nd consecutive letter converted to
|
||||
// upper case.
|
||||
if (!has_lower) {
|
||||
const char_u *p = (char_u *)compl_orig_text;
|
||||
const char *p = compl_orig_text;
|
||||
for (int i = 0; i < min_len; i++) {
|
||||
const int c = mb_ptr2char_adv(&p);
|
||||
if (was_letter && mb_isupper(c) && mb_islower(wca[i])) {
|
||||
@@ -641,7 +641,7 @@ static char *ins_compl_infercase_gettext(const char *str, int char_len, int comp
|
||||
|
||||
// Copy the original case of the part we typed.
|
||||
{
|
||||
const char_u *p = (char_u *)compl_orig_text;
|
||||
const char *p = compl_orig_text;
|
||||
for (int i = 0; i < min_len; i++) {
|
||||
const int c = mb_ptr2char_adv(&p);
|
||||
if (mb_islower(c)) {
|
||||
@@ -2857,7 +2857,7 @@ static int process_next_cpt_value(ins_compl_next_state_T *st, int *compl_type_ar
|
||||
// Remember the first match so that the loop stops when we
|
||||
// wrap and come back there a second time.
|
||||
st->set_match_pos = true;
|
||||
} else if (vim_strchr("buwU", *st->e_cpt) != NULL
|
||||
} else if (vim_strchr("buwU", (uint8_t)(*st->e_cpt)) != NULL
|
||||
&& (st->ins_buf = ins_compl_next_buf(st->ins_buf, *st->e_cpt)) != curbuf) {
|
||||
// Scan a buffer, but not the current one.
|
||||
if (st->ins_buf->b_ml.ml_mfp != NULL) { // loaded buffer
|
||||
@@ -3161,7 +3161,7 @@ static int get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_
|
||||
compl_direction, compl_pattern);
|
||||
} else {
|
||||
found_new_match = searchit(NULL, st->ins_buf, st->cur_match_pos,
|
||||
NULL, compl_direction, (char_u *)compl_pattern, 1L,
|
||||
NULL, compl_direction, compl_pattern, 1L,
|
||||
SEARCH_KEEP + SEARCH_NFMSG, RE_LAST, NULL);
|
||||
}
|
||||
msg_silent--;
|
||||
|
Reference in New Issue
Block a user