diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/mbyte.c | 3 | ||||
-rw-r--r-- | src/nvim/ops.c | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index fd353d8a67..f8451e62e2 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -1323,6 +1323,9 @@ int utf_fold(int a) // invalid values or can't handle latin1 when the locale is C. // Speed is most important here. +// Note: UnicodeData.txt does not define U+1E9E as being the corresponding upper +// case letter for U+00DF (ß), however it is part of the toLower table + /// Return the upper-case equivalent of "a", which is a UCS-4 character. Use /// simple case folding. int mb_toupper(int a) diff --git a/src/nvim/ops.c b/src/nvim/ops.c index d785be54e5..f91df49e4f 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -2165,16 +2165,16 @@ bool swapchar(int op_type, pos_T *pos) return false; } - if (op_type == OP_UPPER && c == 0xdf) { + // ~ is OP_NOP, g~ is OP_TILDE, gU is OP_UPPER + if ((op_type == OP_UPPER || op_type == OP_NOP || op_type == OP_TILDE) && c == 0xdf) { pos_T sp = curwin->w_cursor; - // Special handling of German sharp s: change to "SS". + // Special handling for lowercase German sharp s (ß): convert to uppercase (ẞ). curwin->w_cursor = *pos; del_char(false); - ins_char('S'); - ins_char('S'); + ins_char(0x1E9E); curwin->w_cursor = sp; - inc(pos); + return true; } int nc = c; |