Mercurial > vim
comparison src/diff.c @ 18251:c8a53c0daeed v8.1.2120
patch 8.1.2120: some MB_ macros are more complicated than necessary
Commit: https://github.com/vim/vim/commit/1614a14901558ca091329315d14a7d5e1b53aa47
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 6 22:00:13 2019 +0200
patch 8.1.2120: some MB_ macros are more complicated than necessary
Problem: Some MB_ macros are more complicated than necessary. (Dominique
Pelle)
Solution: Simplify the macros. Expand inline.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 06 Oct 2019 22:15:04 +0200 |
parents | 5c8906f653f5 |
children | 9e6d5a4abb1c |
comparison
equal
deleted
inserted
replaced
18250:f1d9d3f76c98 | 18251:c8a53c0daeed |
---|---|
742 char_u cbuf[MB_MAXBYTES + 1]; | 742 char_u cbuf[MB_MAXBYTES + 1]; |
743 | 743 |
744 // xdiff doesn't support ignoring case, fold-case the text. | 744 // xdiff doesn't support ignoring case, fold-case the text. |
745 c = PTR2CHAR(s); | 745 c = PTR2CHAR(s); |
746 c = enc_utf8 ? utf_fold(c) : MB_TOLOWER(c); | 746 c = enc_utf8 ? utf_fold(c) : MB_TOLOWER(c); |
747 orig_len = MB_PTR2LEN(s); | 747 orig_len = mb_ptr2len(s); |
748 if (mb_char2bytes(c, cbuf) != orig_len) | 748 if (mb_char2bytes(c, cbuf) != orig_len) |
749 // TODO: handle byte length difference | 749 // TODO: handle byte length difference |
750 mch_memmove(ptr + len, s, orig_len); | 750 mch_memmove(ptr + len, s, orig_len); |
751 else | 751 else |
752 mch_memmove(ptr + len, cbuf, orig_len); | 752 mch_memmove(ptr + len, cbuf, orig_len); |