diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-04-10 15:23:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-10 15:23:44 +0200 |
commit | fec53f0bdf5b871c1f6ca818d5a5c52118f5c266 (patch) | |
tree | fe6f9dc4ba3788fe6fea8ac599974904861257c3 /src/nvim/edit.c | |
parent | dd7f41e5a04c14255893e8b986e42e4c62902e1b (diff) | |
parent | c1cf03398143f4dc0ac9155988edad349d24deca (diff) | |
download | rneovim-fec53f0bdf5b871c1f6ca818d5a5c52118f5c266.tar.gz rneovim-fec53f0bdf5b871c1f6ca818d5a5c52118f5c266.tar.bz2 rneovim-fec53f0bdf5b871c1f6ca818d5a5c52118f5c266.zip |
Merge #6479 from bfredl/tolower
remove vim_tolower/etc functions with broken locale-dependent behavior
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index b35504908e..fe00027dec 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -2037,12 +2037,12 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int } else { c = *(p++); } - if (vim_islower(c)) { + if (mb_islower(c)) { has_lower = true; - if (vim_isupper(wca[i])) { + if (mb_isupper(wca[i])) { // Rule 1 is satisfied. for (i = actual_compl_length; i < actual_len; i++) { - wca[i] = vim_tolower(wca[i]); + wca[i] = mb_tolower(wca[i]); } break; } @@ -2062,14 +2062,14 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int } else { c = *(p++); } - if (was_letter && vim_isupper(c) && vim_islower(wca[i])) { + if (was_letter && mb_isupper(c) && mb_islower(wca[i])) { // Rule 2 is satisfied. for (i = actual_compl_length; i < actual_len; i++) { - wca[i] = vim_toupper(wca[i]); + wca[i] = mb_toupper(wca[i]); } break; } - was_letter = vim_islower(c) || vim_isupper(c); + was_letter = mb_islower(c) || mb_isupper(c); } } @@ -2082,10 +2082,10 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int } else { c = *(p++); } - if (vim_islower(c)) { - wca[i] = vim_tolower(wca[i]); - } else if (vim_isupper(c)) { - wca[i] = vim_toupper(wca[i]); + if (mb_islower(c)) { + wca[i] = mb_tolower(wca[i]); + } else if (mb_isupper(c)) { + wca[i] = mb_toupper(wca[i]); } } } @@ -2302,9 +2302,10 @@ static void ins_compl_longest_match(compl_T *match) c1 = *p; c2 = *s; } - if (match->cp_icase ? (vim_tolower(c1) != vim_tolower(c2)) - : (c1 != c2)) + if (match->cp_icase ? (mb_tolower(c1) != mb_tolower(c2)) + : (c1 != c2)) { break; + } if (has_mbyte) { mb_ptr_adv(p); mb_ptr_adv(s); |