diff options
author | Dundar Goc <gocdundar@gmail.com> | 2022-04-29 13:53:42 +0200 |
---|---|---|
committer | Dundar Goc <gocdundar@gmail.com> | 2022-04-29 14:13:06 +0200 |
commit | eef8de4df0247157e57f306062b1b86e01a41454 (patch) | |
tree | 949a172d60f0f58e04f99e18db038c435a909825 /src/nvim/mbyte.c | |
parent | 0b3ae64480ea28bb57783c2269a61f0a60ffc55e (diff) | |
download | rneovim-eef8de4df0247157e57f306062b1b86e01a41454.tar.gz rneovim-eef8de4df0247157e57f306062b1b86e01a41454.tar.bz2 rneovim-eef8de4df0247157e57f306062b1b86e01a41454.zip |
refactor(uncrustify): change rules to better align with the style guide
Add space around arithmetic operators '+' and '-'.
Remove space between back-to-back parentheses, i.e. ')(' vs. ') ('.
Remove space between '((' or '))' of control statements.
Add space between ')' and '{' of control statements.
Remove space between function name and '(' on function declaration.
Collapse empty blocks between '{' and '}'.
Remove newline at the end of the file.
Remove newline between 'enum' and '{'.
Remove newline between '}' and ')' in a function invocation.
Remove newline between '}' and 'while' of 'do' statement.
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r-- | src/nvim/mbyte.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 6e3c5322e7..10744a86dc 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -584,8 +584,8 @@ size_t mb_string2cells_len(const char_u *str, size_t size) { size_t clen = 0; - for (const char_u *p = str; *p != NUL && p < str+size; - p += utfc_ptr2len_len(p, size+(p-str))) { + for (const char_u *p = str; *p != NUL && p < str + size; + p += utfc_ptr2len_len(p, size + (p - str))) { clen += utf_ptr2cells(p); } @@ -808,7 +808,7 @@ int utfc_ptr2char_len(const char_u *p, int *pcc, int maxlen) int len_cc = utf_ptr2len_len(p + len, maxlen - len); safe = len_cc > 1 && len_cc <= maxlen - len; if (!safe || (pcc[i] = utf_ptr2char(p + len)) < 0x80 - || !(i == 0 ? utf_composinglike(p, p+len) : utf_iscomposing(pcc[i]))) { + || !(i == 0 ? utf_composinglike(p, p + len) : utf_iscomposing(pcc[i]))) { break; } len += len_cc; @@ -1507,10 +1507,10 @@ void mb_utflen(const char_u *s, size_t len, size_t *codepoints, size_t *codeunit size_t count = 0, extra = 0; size_t clen; for (size_t i = 0; i < len && s[i] != NUL; i += clen) { - clen = utf_ptr2len_len(s+i, len-i); + clen = utf_ptr2len_len(s + i, len - i); // NB: gets the byte value of invalid sequence bytes. // we only care whether the char fits in the BMP or not - int c = (clen > 1) ? utf_ptr2char(s+i) : s[i]; + int c = (clen > 1) ? utf_ptr2char(s + i) : s[i]; count++; if (c > 0xFFFF) { extra++; @@ -1529,16 +1529,16 @@ ssize_t mb_utf_index_to_bytes(const char_u *s, size_t len, size_t index, bool us return 0; } for (i = 0; i < len && s[i] != NUL; i += clen) { - clen = utf_ptr2len_len(s+i, len-i); + clen = utf_ptr2len_len(s + i, len - i); // NB: gets the byte value of invalid sequence bytes. // we only care whether the char fits in the BMP or not - int c = (clen > 1) ? utf_ptr2char(s+i) : s[i]; + int c = (clen > 1) ? utf_ptr2char(s + i) : s[i]; count++; if (use_utf16_units && c > 0xFFFF) { count++; } if (count >= index) { - return i+clen; + return i + clen; } } return -1; |