diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-03-04 13:10:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-04 20:10:00 +0800 |
commit | 6cab36e5b7b0d741abe6c5a7c0e20bad30361034 (patch) | |
tree | 8f00dab70b4a63ff572600a6e4824f59b0ae29c6 /src/nvim/keycodes.c | |
parent | a4f443994bb91321b00f29af9e6357df9102ce75 (diff) | |
download | rneovim-6cab36e5b7b0d741abe6c5a7c0e20bad30361034.tar.gz rneovim-6cab36e5b7b0d741abe6c5a7c0e20bad30361034.tar.bz2 rneovim-6cab36e5b7b0d741abe6c5a7c0e20bad30361034.zip |
refactor: replace char_u with char or uint8_t (#22400)
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/keycodes.c')
-rw-r--r-- | src/nvim/keycodes.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/keycodes.c b/src/nvim/keycodes.c index 8114efc10c..404087fec3 100644 --- a/src/nvim/keycodes.c +++ b/src/nvim/keycodes.c @@ -723,7 +723,7 @@ int find_special_key(const char **const srcp, const size_t src_len, int *const m if (modifiers != 0 && last_dash[l + 1] == '>') { key = utf_ptr2char(last_dash + off); } else { - key = get_special_key_code((char_u *)last_dash + off); + key = get_special_key_code(last_dash + off); if (!(flags & FSK_KEEP_X_KEY)) { key = handle_x_keys(key); } @@ -822,18 +822,18 @@ int find_special_key_in_table(int c) /// a termcap name. /// /// @return Key code or 0 if not found. -int get_special_key_code(const char_u *name) +int get_special_key_code(const char *name) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { for (int i = 0; key_names_table[i].name != NULL; i++) { const char *const table_name = key_names_table[i].name; int j; - for (j = 0; ascii_isident(name[j]) && table_name[j] != NUL; j++) { - if (TOLOWER_ASC(table_name[j]) != TOLOWER_ASC(name[j])) { + for (j = 0; ascii_isident((uint8_t)name[j]) && table_name[j] != NUL; j++) { + if (TOLOWER_ASC(table_name[j]) != TOLOWER_ASC((uint8_t)name[j])) { break; } } - if (!ascii_isident(name[j]) && table_name[j] == NUL) { + if (!ascii_isident((uint8_t)name[j]) && table_name[j] == NUL) { return key_names_table[i].key; } } |