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/ops.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/ops.c')
-rw-r--r-- | src/nvim/ops.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 68ef27222c..f11d6b69b2 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1956,16 +1956,18 @@ int swapchar(int op_type, pos_T *pos) if (enc_dbcs != 0 && c >= 0x100) /* No lower/uppercase letter */ return FALSE; nc = c; - if (vim_islower(c)) { - if (op_type == OP_ROT13) + if (mb_islower(c)) { + if (op_type == OP_ROT13) { nc = ROT13(c, 'a'); - else if (op_type != OP_LOWER) - nc = vim_toupper(c); - } else if (vim_isupper(c)) { - if (op_type == OP_ROT13) + } else if (op_type != OP_LOWER) { + nc = mb_toupper(c); + } + } else if (mb_isupper(c)) { + if (op_type == OP_ROT13) { nc = ROT13(c, 'A'); - else if (op_type != OP_UPPER) - nc = vim_tolower(c); + } else if (op_type != OP_UPPER) { + nc = mb_tolower(c); + } } if (nc != c) { if (enc_utf8 && (c >= 0x80 || nc >= 0x80)) { @@ -3327,10 +3329,11 @@ void ex_display(exarg_T *eap) get_clipboard(name, &yb, true); - if (name == vim_tolower(redir_reg) - || (redir_reg == '"' && yb == y_previous)) - continue; /* do not list register being written to, the - * pointer can be freed */ + if (name == mb_tolower(redir_reg) + || (redir_reg == '"' && yb == y_previous)) { + continue; // do not list register being written to, the + // pointer can be freed + } if (yb->y_array != NULL) { msg_putchar('\n'); |