aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjulio-b <julio.bacel@gmail.com>2023-08-26 23:15:33 +0000
committerGitHub <noreply@github.com>2023-08-27 07:15:33 +0800
commite8dd3fa280f44fa565533b70b37fbb688c54c5b5 (patch)
treed85900d18ff2290955618968d5390851cc7a5f56
parenta6d0535c15374599e0dd9ca891d9fbc7b5774403 (diff)
downloadrneovim-e8dd3fa280f44fa565533b70b37fbb688c54c5b5.tar.gz
rneovim-e8dd3fa280f44fa565533b70b37fbb688c54c5b5.tar.bz2
rneovim-e8dd3fa280f44fa565533b70b37fbb688c54c5b5.zip
refactor(buf_init_chartab): remove redundant loop (#24891)
-rw-r--r--src/nvim/charset.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index 2756a60d60..c4ff712f3a 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -112,19 +112,13 @@ int buf_init_chartab(buf_T *buf, int global)
while (c < 256) {
if (c >= 0xa0) {
// UTF-8: bytes 0xa0 - 0xff are printable (latin1)
- g_chartab[c++] = CT_PRINT_CHAR + 1;
+ // Also assume that every multi-byte char is a filename character.
+ g_chartab[c++] = (CT_PRINT_CHAR | CT_FNAME_CHAR) + 1;
} else {
// the rest is unprintable by default
g_chartab[c++] = (dy_flags & DY_UHEX) ? 4 : 2;
}
}
-
- // Assume that every multi-byte char is a filename character.
- for (c = 1; c < 256; c++) {
- if (c >= 0xa0) {
- g_chartab[c] |= CT_FNAME_CHAR;
- }
- }
}
// Init word char flags all to false